Skip to content

zooooooooom/NBBannerView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBBannerView

CI Status Version License Platform

示例图片

image

使用方式

    NBBannerView *bannerV = [NBBannerView bannerViewWithConfig:^(NBBannerConfig *config) {
    //        config.blurEffectViewColor = [UIColor redColor];
        config.showBlurEffectView = YES;
        config.showText = NO;
    //        config.textColor = [UIColor purpleColor];
    //        config.textFontSize = 36;
    } loadImageBlock:^(UIImageView *imageView, NSURL *url) {
        [imageView sd_setImageWithURL:url placeholderImage:nil];
    } loadBlurEffectBlock:^(UIImageView *imageView, NSURL *url) {
        [imageView sd_setImageWithURL:url placeholderImage:nil];
    }];
        [self.view addSubview:bannerV];
        [bannerV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.view).offset(64);
            make.left.right.equalTo(self.view);
            make.height.equalTo(bannerV.mas_width).multipliedBy(0.6);
            }];

    NSMutableArray *arrM = [NSMutableArray array];
    for (int i = 0; i<arrData.count; i++) {
        BannerModel *bannerM = [[BannerModel alloc] init];
        bannerM.imageURL = arrData[i];
    //        bannerM.title = [NSString stringWithFormat:@"%zd",i];
        [arrM addObject:bannerM];
    }

    bannerV.bannerModels = arrM;

Installation

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

pod 'NBBannerView'

Author

shiyingfeng, 260497176@qq.com

License

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