Latest 0.1.0
Homepage https://github.com/syzhou1223/CCLoopScrollView
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CCLoopScrollView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'CCLoopScrollView'

运行效果

img

使用示例

CCLoopScrollView *loopScrollViewTop = [[CCLoopScrollView alloc] initWithFrame:CGRectMake(0, 110, self.view.frame.size.width, 100)];
loopScrollViewTop.delegate = self;
loopScrollViewTop.autoScrollDelay = 2.0;
[self.view addSubview:loopScrollViewTop];

#pragma mark - CCLoopScrollView Delegate
- (NSInteger)numberOfPageInLoopScrollView:(CCLoopScrollView *)loopScrollView {
    return [self getRandomNumber:1 to:_colors.count];
}

- (UIView *)loopScrollView:(CCLoopScrollView *)loopScrollView viewForPageAtIndex:(NSInteger)index withPosition:(NSInteger)position {
    CCBannerView *pageView = (CCBannerView *)[loopScrollView dequeueReusableViewWithPosition:position];
    if (!pageView) {
        pageView = [[CCBannerView alloc] initWithFrame:loopScrollView.bounds];
    }

    [pageView setTitle:[NSString stringWithFormat:@"第 %ld 页",index + 1]];

    if (index < _colors.count) {
        [pageView setBackgroundColor:[_colors objectAtIndex:index]];
    }

    return pageView;
}

Author

zhoushaoyou, [email protected]

License

CCLoopScrollView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CCLoopScrollView",
    "version": "0.1.0",
    "summary": "u4e00u4e2au8f7bu91cfu7ea7u7684u5faau73afu6ed1u52a8u7ec4u4ef6uff0cu53eau75283u4e2aPageu5b9eu73b0u5faau73afu6edau52a8uff0cu53efu81eau5b9au4e49u7ffbu9875u52a8u753bu7684u65f6u95f4u548cu6548u679c",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/syzhou1223/CCLoopScrollView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "zhoushaoyou": "[email protected]"
    },
    "source": {
        "git": "https://github.com/syzhou1223/CCLoopScrollView.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CCLoopScrollView/Classes/**/*"
}

Pin It on Pinterest

Share This