Latest 1.0.5
Homepage https://github.com/Hijin/NJBannerView
License MIT
Platforms ios 7.0, requires ARC
Dependencies SDWebImage
Frameworks ImageIO, Foundation
Authors

NJBannerViewDemo

NJBannerView是一个轻量级的简单易用的用于展示广告循环滚动的开源库,效率高,占用内存小,支持本地图片和网络图片,两者可混合,广告页数量任意,实现图片点击事件,可自定义pageControl。

一张图片的使用效果

one picture

两张图片的使用效果

two pictures

三张以上图片效果

three pictures

CocoaPods引入安装

在Podfile中加入

platform :ios, '7.0'
pod 'NJBannerView', '~> 1.0.5'

使用

datas

datas:字典数组,key:img,value:本地图片名或网络图片地址

bannerView需要显示的图片字典数组

NJBannerView *bannerV = [[NJBannerView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 150)];

 bannerV.datas = [NSMutableArray arrayWithObjects:
                @{@"img":@"homepage_defaultbanner1.jpg",@"link":@"banner1"},
                @{@"img":@"http://p700.oschina.io/b/01.png",@"link":@"banner2"},
//              @{@"img":@"homepage_defaultbanner3.jpg",@"link":@"banner3"},
//              @{@"img":@"homepage_defaultbanner2.jpg",@"link":@"banner4"},
                nil];

linkAction

点击广告页事件,不需要时可无需设置

__unsafe_unretained ViewController *vc = self;
bannerV.linkAction = ^(NSString *link)
    {
        [vc bannerLink:link];
    };

自己写的第一个开源库,有问题欢迎指出,以后会更新添加其他功能。QQ:1553877174 微信:cnj901212 邮箱:[email protected]

Latest podspec

{
    "name": "NJBannerView",
    "version": "1.0.5",
    "summary": "design bannerView for iOS",
    "homepage": "https://github.com/Hijin/NJBannerView",
    "license": "MIT",
    "authors": {
        "Hijin": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Hijin/NJBannerView.git",
        "tag": "1.0.5"
    },
    "source_files": "NJBannerViewDemo/NJBannerViewDemo/NJBannerView/*.{h,m}",
    "frameworks": [
        "ImageIO",
        "Foundation"
    ],
    "requires_arc": true,
    "dependencies": {
        "SDWebImage": [
            "~>3.8"
        ]
    }
}

Pin It on Pinterest

Share This