Latest 1.0.0
Homepage https://github.com/keleyundou/RTRunLoopBannerDemo
License MIT
Platforms ios 8.0
Authors

RTRunLoopBanner

一个轮播控件

Installation

pod RTRunLoopBanner

Usage

  • 初始化
    self.bannerView = [[RTRunnLoopBannerView alloc] initWithFrame:(CGRect){0,100,SCREEN_WIDTH, 100}];
    self.bannerView.backgroundColor = [UIColor blackColor];
    _bannerView.dataSource = self;
    _bannerView.delegate = self;
    _bannerView.pageIndicatorTintColor = [UIColor redColor];
    _bannerView.currentPageIndicatorTintColor = [UIColor greenColor];
    _bannerView.pageControlPos = RTPageControlShowPositionBottomCenter;
    [self.view addSubview:_bannerView];
  • callback
#pragma mark - ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ RTRunLoopBannerViewDataSource ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
- (NSArray *)dataSourceInRunLoopBannerView:(RTRunnLoopBannerView *)bannerView {
    return dataSource;
}

- (void)bannerView:(RTRunnLoopBannerView *)bannerView loadImageView:(UIImageView *)imgView atIndex:(NSUInteger)index {
    //定制化加载图片 可根据回调的索引 加载资源(静态图或URL)
    [imgView sd_setImageWithURL:[NSURL URLWithString:dataSource[index]]];
}

#pragma mark - ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ RTRunLoopBannerViewDelegate ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
- (void)bannerView:(RTRunnLoopBannerView *)bannerView didSelectedImageAtIndex:(NSInteger)index {
    NSLog(@"did current image index : %ld", index);
}

- (CGRect)customPageControlPostionWithBannerView:(RTRunnLoopBannerView *)bannerView {
    return (CGRect){10,0,0,30};
}

- (CGFloat)dotSize {
    return 10;
}

- (CGFloat)dotHorizontalSpacing {
    return 10;
}

Latest podspec

{
    "name": "RTRunLoopBanner",
    "version": "1.0.0",
    "summary": "RTRunLoopBanner is a simple Module.",
    "description": "RTRunLoopBanner is a simple Module. It's use to so easied.",
    "homepage": "https://github.com/keleyundou/RTRunLoopBannerDemo",
    "license": "MIT",
    "authors": {
        "ColaBean": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/keleyundou/RTRunLoopBannerDemo.git",
        "tag": "1.0.0"
    },
    "source_files": "RTRunLoopBannerDemo/Classes/**/*.{h,m}"
}

Pin It on Pinterest

Share This