Latest 1.5.1
Homepage https://github.com/iamhmx/MXScrollView
License MIT
Platforms ios 8.0
Dependencies SDWebImage
Authors

循环滚动视图(支持点击事件、自动滚动、多种动画)

效果图

  • 无动画
    无动画

  • 渐变
    渐变

  • 旋转
    旋转

  • 缩放
    缩放

  • 上升
    上升

  • 下降
    下降

  • 毛玻璃
    毛玻璃

    使用说明

  • Cocoapods安装
    • pod ‘MXCycleScrollView’
  • 添加文件
    • 将MXCycleScrollView文件夹(包含MXCycleScrollViewHeader.h、MXCycleScrollView.h、MXCycleScrollView.m)添加到项目中

      代码示例

      
      /*ViewController.m*/
      #import "MXCycleScrollView.h"

@interface ViewController ()
//图片数据
@property (strong, nonatomic) NSArray *imageUrls;
@end

@implementation ViewController

  • (void)viewDidLoad {
    [super viewDidLoad];
    /初始化一:已知图片数据/
    MXCycleScrollView *mxScrollView = [[MXCycleScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 200) withContents:self.imageUrls andScrollDelay:3.5];

    /初始化二:不知图片数据,数据由网络请求而来,更常见/
    /MXCycleScrollView mxScrollView = [[MXCycleScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 200) withScrollDelay:3.5];
    //请求到数据,设置图片
    [self requestDataFromNet:^(id data) {
    [mxScrollView setContents:data];
    }];*/

    //设置动画类型
    //渐变 MXImageAnimationFadeInOut;
    //旋转 MXImageAnimationRotation;
    //缩放 MXImageAnimationScale;
    // mxScrollView.scaleRatio = 0.5;
    //上升 MXImageAnimationUp;
    //下降 MXImageAnimationDown;
    //毛玻璃
    mxScrollView.animationType = MXImageAnimationBlur;

    //方法一:设置代理并实现方法
    //mxScrollView.delegate = self;

    //方法二:设置回调Block
    mxScrollView.clickHandler = ^(NSInteger index) {
    NSLog(@"图片index:%ld",index);
    };

    [self.view addSubview:mxScrollView];
    }

  • (void)clickImageIndex:(NSInteger)index {
    NSLog(@"图片index:%ld",index);
    }

  • (NSArray *)imageUrls {
    return @[@"http://a2.att.hudong.com/73/16/01300000165476121211162421024.jpg", @"http://pic8.nipic.com/20100808/4953913_162517044879_2.jpg”,@”http://www.taopic.com/uploads/allimg/121214/267863-12121421114939.jpg"];
    }

@end

Latest podspec

{
    "name": "MXCycleScrollView",
    "version": "1.5.1",
    "summary": "u5faau73afu6edau52a8u89c6u56fe",
    "description": "u5faau73afu6edau52a8u89c6u56fe(u652fu6301u70b9u51fbu4e8bu4ef6u3001u81eau52a8u6edau52a8u3001u591au79cdu52a8u753b)",
    "homepage": "https://github.com/iamhmx/MXScrollView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "HuangMingxing": "hmxing099097@163.com"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/iamhmx/MXScrollView.git",
        "tag": "1.5.1"
    },
    "source_files": "MXCycleScrollView/*.{h,m}",
    "dependencies": {
        "SDWebImage": []
    }
}

Pin It on Pinterest

Share This