Latest 1.0.0
Homepage https://github.com/huluo666/HJCycleScrollView
License MIT Copyright 2016
Permission is granted to…
Platforms ios 7.0
Authors

自动循环滚动ScrollView,适用于首页banna广告图,使用复用机制,节约内存。
可加载本地图片和网络图片,也可以混合本地和网络图片url使用

pod ‘HJCycleScrollView’, ‘~> 1.0.0’

1.基本使用

  HJCycleScrollView  * _scrollView=[[HJCycleScrollView alloc]initWithFrame:CGRectMake(0, 20, kScreen_Width,  210*(kScreen_Width/320)) Duration:3 pageControlHeight:20];
  _scrollView.delegate=self;
  [self.view addSubview:_scrollView];

  NSArray *[email protected][@"1.jpg",@"2.jpg",@"3.jpg",@"4.jpg",@"5.jpg"];
  _scrollView.imageArray=images;

  /*不设置数据源则不显示*/
  _scrollView.titleArray=images;

2.刷新数据

#pragma mark ----刷新Scrollview,一般首页会有下拉刷新功能---
/*重置数据源*/
-(void)refreshScrollview
{
    NSArray *[email protected][@"3.jpg",@"2.jpg",@"5.jpg",@"3.jpg",@"0.jpg"];
    self.scrollView.imageArray=images;
    self.scrollView.titleArray=images;
}

注意在页面切换是开启关闭定时器

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    //开启定时器 DDCycleScrollView自动滚动
    [[NSNotificationCenter  defaultCenter]  postNotificationName:HJCycleScrollViewOpenTimerNotiName object:nil userInfo:nil];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];

    //关闭定时器  DDCycleScrollView停止自动滚动
    [[NSNotificationCenter  defaultCenter]  postNotificationName:HJCycleScrollViewOpenTimerNotiName object:nil userInfo:nil];
}

Latest podspec

{
    "name": "HJCycleScrollView",
    "version": "1.0.0",
    "summary": "u81eau52a8u5faau73afu6edau52a8ScrollView",
    "description": "u81eau52a8u5faau73afu6edau52a8Banna ScrollView",
    "homepage": "https://github.com/huluo666/HJCycleScrollView",
    "license": {
        "type": "MIT",
        "text": "                   Copyright 2016n                   Permission is granted to...n"
    },
    "authors": {
        "Hu7f57": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/huluo666/HJCycleScrollView.git",
        "tag": "1.0.0"
    },
    "source_files": [
        "Classes",
        "HJCycleScrollView/**/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This