CarouselBannerView - 无限轮播条 swift版
wbtx9480
9年前
用swift编写的轮播条,需要在controller 里实现三个协议
func scrollView(toScrollView scrollView: CarouselBannerView, andImageAtIndex index: NSInteger, forImageView imageView: UIImageView) { imageView.kf_setImageWithURL(NSURL(string: imageSource.objectAtIndex(index) as! String)!, placeholderImage: UIImage.init(named: "banner_bgImage")) //通过网络图片地址显示图片 } func numberOfImageInScrollView(toScrollView scrollView: CarouselBannerView) -> Int { return imageSource.count //图片个数 } func scrollView ( toScrollView scrollView : CarouselBannerView, didTappedImageAtIndex index : NSInteger){ print("点击\(index)") //图片点击事件 }