輪播圖控件 帶描述文字的輪播圖控件

項目需導入SDWebImage

類型一

簡單的輪播圖

輪播下.gif
/**
    加載演示類型1  圖
    */
   _jy2ScrollView = [[JYScrollView alloc] initWithFrame:CGRectMake(0, Fit375(350), kScreenWidth, Fit375(230))];
   [_jy2ScrollView bannerWithArray:array imageType:JYImageURLType placeHolder:@"placeholderImage.jpg" tapAction:^(NSInteger index) {
       NSLog(@"點擊了輪播圖click   NO.%ld",index);
   }];
   _jy2ScrollView.timeInterval = 4;
   [self.view addSubview:_jy2ScrollView];

類型二

帶描述的輪播圖

輪播上.gif
/**
     加載演示類型2  圖 + 描述
     */
    /**
     set UI frame,JYScrollview's pageControl is depend on the screen's width,if you want to make a different one you could click JYScrollView.m to change the size or something.
     */
    _jyScrollView = [[JYScrollView alloc] initWithFrame:CGRectMake(0, Fit375(50), kScreenWidth, Fit375(230))];
    /**
     *  the array's count must equals to the titleArr's
     *  loadScrollViewData
     */
    [_jyScrollView bannerWithArray:array titleArr:titleArr imageType:JYImageURLType placeHolder:@"placeholderImage.jpg" tapAction:^(NSInteger index) {
        NSLog(@"點擊了輪播圖click   NO.%ld",index);
    }];
    _jyScrollView.timeInterval = 1;
    [self.view addSubview:_jyScrollView];

自定義pageControl的位置

    /**
     *  or you can set the pageControl
     *
     CGPoint center =_jy2ScrollView.pageControl.center;
     center.x = 350;
     _jy2ScrollView.pageControl.center = center;
     */

如果控件哪里有什么問題,敬請斧正。

-------github demo鏈接-----

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,813評論 25 708
  • 發(fā)現(xiàn) 關注 消息 iOS 第三方庫、插件、知名博客總結 作者大灰狼的小綿羊哥哥關注 2017.06.26 09:4...
    肇東周閱讀 12,180評論 4 61
  • 崩潰。今天姨媽痛,我甚至還在想,要是沒分開我可以向他訴苦了??尚Π?,其實我知道他不喜歡我了,還這么想的美,干什么呢...
    裳瓔珞閱讀 167評論 0 1
  • 一珊,紫瑤的聲音響起。 她從床上坐起來,怎么了,紫瑤? 唉喲快別提了,紫瑤大大咧咧的在一珊的床上坐下,還沒開始說話...
    十三夜叛閱讀 569評論 0 1
  • 如果你有幾個好消息要公布,你是應該分開宣布呢,還是一起宣布? 假如你今天中了1000元,同時你的股票總體漲了100...
    草酰盛閱讀 673評論 0 0