diff --git a/RCPageControlExample/RCPageControlExample.xcodeproj/project.pbxproj b/RCPageControlExample/RCPageControlExample.xcodeproj/project.pbxproj index 864db5e..ca36bb9 100644 --- a/RCPageControlExample/RCPageControlExample.xcodeproj/project.pbxproj +++ b/RCPageControlExample/RCPageControlExample.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 6E193FF01A0665C200F6FE20 /* avatar@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6E193FEF1A0665C200F6FE20 /* avatar@2x.png */; }; 6E2F733B19C72600008985F7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F733A19C72600008985F7 /* main.m */; }; 6E2F733E19C72600008985F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F733D19C72600008985F7 /* AppDelegate.m */; }; 6E2F734119C72600008985F7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E2F734019C72600008985F7 /* ViewController.m */; }; @@ -28,6 +29,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 6E193FEF1A0665C200F6FE20 /* avatar@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "avatar@2x.png"; sourceTree = ""; }; 6E2F733519C72600008985F7 /* RCPageControlExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RCPageControlExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6E2F733919C72600008985F7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6E2F733A19C72600008985F7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; @@ -103,6 +105,7 @@ 6E2F733819C72600008985F7 /* Supporting Files */ = { isa = PBXGroup; children = ( + 6E193FEF1A0665C200F6FE20 /* avatar@2x.png */, 6E2F733919C72600008985F7 /* Info.plist */, 6E2F733A19C72600008985F7 /* main.m */, ); @@ -218,6 +221,7 @@ buildActionMask = 2147483647; files = ( 6E2F734419C72600008985F7 /* Main.storyboard in Resources */, + 6E193FF01A0665C200F6FE20 /* avatar@2x.png in Resources */, 6E2F734919C72601008985F7 /* LaunchScreen.xib in Resources */, 6E2F734619C72601008985F7 /* Images.xcassets in Resources */, ); diff --git a/RCPageControlExample/RCPageControlExample/Base.lproj/LaunchScreen.xib b/RCPageControlExample/RCPageControlExample/Base.lproj/LaunchScreen.xib index 961d344..0ce35f3 100644 --- a/RCPageControlExample/RCPageControlExample/Base.lproj/LaunchScreen.xib +++ b/RCPageControlExample/RCPageControlExample/Base.lproj/LaunchScreen.xib @@ -1,7 +1,7 @@ - + - + @@ -25,19 +25,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RCPageControlExample/RCPageControlExample/ViewController.m b/RCPageControlExample/RCPageControlExample/ViewController.m index a4270d9..434cd6c 100644 --- a/RCPageControlExample/RCPageControlExample/ViewController.m +++ b/RCPageControlExample/RCPageControlExample/ViewController.m @@ -83,7 +83,20 @@ } - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view { - UIView *theNewView = view ?: [[UIView alloc] initWithFrame:self.view.frame]; + UIView *theNewView = view ?: ({ + UIView *view = [[UIView alloc] initWithFrame:self.view.frame]; + + [view addSubview:({ + UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)]; + [imageView setCenter:view.center]; + [imageView setImage:[UIImage imageNamed:@"avatar"]]; + [imageView.layer setCornerRadius:imageView.frame.size.height / 2]; + [imageView.layer setMasksToBounds:YES]; + imageView; + })]; + + view; + }); [theNewView setBackgroundColor:index % 3 ? index % 2 ? [[UIColor purpleColor] colorWithAlphaComponent:0.5] : [[UIColor blueColor] colorWithAlphaComponent:0.5] : [[UIColor cyanColor] colorWithAlphaComponent:0.5]]; diff --git a/RCPageControlExample/RCPageControlExample/avatar@2x.png b/RCPageControlExample/RCPageControlExample/avatar@2x.png new file mode 100644 index 0000000..710587b Binary files /dev/null and b/RCPageControlExample/RCPageControlExample/avatar@2x.png differ