轮播图控件 带描述文字的轮播图控件

2017-04-19  本文已影响157人  码修

项目需导入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链接-----

上一篇 下一篇

猜你喜欢

热点阅读