無限循環輪播器:本地圖片,網絡圖片(緩存):KNBannerView
KNBannerView
無限循環輪播器:本地圖片,網絡圖片(緩存)
KNBannerView
無限循環輪播器:本地圖片,網絡圖片(圖片緩存)
KNBannerView
一.功能描述及要點
1.無限圖片輪播器,加載本地圖片或網絡圖片
2.NSURLSession下載網絡圖片,沙盒路徑存儲圖片(路徑名:MD5加密)
3.通過代理方法執行圖片的點擊事件
4.collectView工作原理實現無限滾動
5.設置UIPageControl的位置:(左,中,右) 以及顏色設置
6.設置描述文字的位置:(左,中,右) 以及字體顏色,大小,背景顏色
二.方法定義及調用
1.類方法創建BannerView:本地圖片和網絡圖片
+ (instancetype)bannerViewWithLocationImagesArr:(NSArray *)locationImgArr frame:(CGRect)frame
+ (instancetype)bannerViewWithNetWorkImagesArr:(NSArray *)netWorkImgArr frame:(CGRect)frame
2.設置bannerView的占位圖,定時器的時間
bannerView.timeInterval = 2;
bannerView.placeHolder = @"3";
3.設置bannerView的PageControl的屬性
bannerView.PageIndicatorTintColor = [UIColor whiteColor];
bannerView.CurrentPageIndicatorTintColor = [UIColor blackColor];
bannerView.pageControlStyle = KNPageControlStyleRight;
4.設置bannerView 介紹文字的屬性
bannerView.IntroduceTextFont = [UIFont systemFontOfSize:20];
bannerView.IntroduceBackGroundAlpha = 1.0;
bannerView.IntroduceBackGroundColor = [UIColor greenColor];
bannerView.IntroduceHeight = 60;
bannerView.IntroduceTextColor = [UIColor redColor];