CarouselBannerView - 無限輪播條 swift版

wbtx9480 8年前發布 | 10K 次閱讀 Apple Swift開發

用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)")  //圖片點擊事件

    }

官方網站:http://www.baiduhome.net/lib/view/home/1453425725933

 本文由用戶 wbtx9480 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!