UICarouselScrollView 1.1.2

UICarouselScrollView 1.1.2

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年10月

skswhwo维护。



  • 作者
  • skswhwo

可用于水平滚动的视图,具有特定的内容宽度。

alt text alt text

安装

UICarouselScrollView可以通过CocoaPods获取。要安装它,只需将以下行添加到Podfile中

pod "UICarouselScrollView"

然后执行

$ pod install

使用方法

代理

@required
- (UIView *)carouselScrollView:(UICarouselScrollView *)view viewAtPage:(NSInteger)page;

@optional
- (void)carouselScrollView:(UICarouselScrollView *)view clickedAtPage:(NSInteger)page;
- (NSString *)carouselScrollView:(UICarouselScrollView *)view titleAtPage:(NSInteger)page;
- (NSString *)carouselScrollView:(UICarouselScrollView *)view subTitleAtPage:(NSInteger)page;

NIB

[self.nibView setDelegate:self];
[self.nibView setSlideTime:3];
[self.nibView setShouldDetectNextAndPreviousClickEvent:NO];
[self.nibView setGradientColors:@[(id)[[UIColor blackColor] colorWithAlphaComponent:0].CGColor,(id)[[UIColor blackColor] colorWithAlphaComponent:0.6].CGColor]];

编程式

carouselView = [[UICarouselScrollView alloc] initWithFrame:CGRectMake(10, 300, 260, 180)];
[self.view addSubview:carouselView];
[carouselView setDelegate:self];
[carouselView setMaxWidth:200];
[carouselView setSlideTime:2];
[carouselView setShouldDetectNextAndPreviousClickEvent:NO];
[carouselView setGradientColors:@[(id)[[UIColor blackColor] colorWithAlphaComponent:0].CGColor,(id)[[UIColor blackColor] colorWithAlphaComponent:0.6].CGColor]];

属性

@property (nonatomic, assign) NSInteger numberOfPage;   //trigger
@property (nonatomic, assign) NSInteger cacheCount; //default = 2 (previous&next pages)
@property (nonatomic, assign) float slideTime;  //if 0, don't auto slide
@property (nonatomic, assign) float maxWidth;   //if 0, view size
@property (nonatomic, assign) BOOL shouldDetectNextAndPreviousClickEvent;

作者

skswhwo, [email protected]

许可证

UICarouselScrollView遵守MIT许可证。有关更多信息,请参阅LICENSE文件。