使用网上源码KYAnimatedPageControl

    self.pageControl = [[KYAnimatedPageControl alloc]initWithFrame:CGRectMake(CGRectGetWidth(self.view.bounds)/-, CGRectGetHeight(self.view.bounds) - , , )];
    self.pageControl.pageCount = ;//数量
    self.pageControl.unSelectedColor = [UIColor colorWithWhite:0.9 alpha:];//未滑动的颜色
    self.pageControl.selectedColor = [UIColor redColor];//滑动的颜色
    self.pageControl.bindScrollView = _scrollView; //需要绑定
    self.pageControl.shouldShowProgressLine = YES;//填充,小球之前的线条变色
    self.pageControl.indicatorStyle = IndicatorStyleGooeyCircle;//样式
    self.pageControl.indicatorSize = ; //圆圈大小
    self.pageControl.swipeEnable = YES;//这有啥用
    [self.pageControl display];//设置完所有参数调用
    
    [self.view addSubview:self.pageControl];
    
    self.pageControl.didSelectIndexBlock = ^(NSInteger index){
        NSLog(@"Did Selected index : %ld",(long)index);
    };

UIScrollViewDelegate:

#pragma mark - <UIScrollViewDelegate>

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    
    //Indicator动画
    [self.pageControl.indicator animateIndicatorWithScrollView:scrollView andIndicator:self.pageControl];
    
    if (scrollView.dragging || scrollView.isDecelerating || scrollView.tracking) {
        //背景线条动画
        [self.pageControl.pageControlLine animateSelectedLineWithScrollView:scrollView];
    }
    
} -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    
    self.pageControl.indicator.lastContentOffset = scrollView.contentOffset.x;
    
} -(void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{
    
    
    [self.pageControl.indicator restoreAnimation:@(1.0/self.pageControl.pageCount)];
    
} - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView{
    self.pageControl.indicator.lastContentOffset = scrollView.contentOffset.x;
}

demo下载地址:http://pan.baidu.com/s/1pJn66pX

效果图:

PageControl(弹性滚动)的更多相关文章

  1. 【原】移动web页面支持弹性滚动的3个方案

    有段时间一直折腾移动端页面弹性滚动的各种问题,做了点研究,今天做个小分享~ 传统 pc 端中,子容器高度超出父容器高度,通常使用 overflow:auto 可出现滚动条拖动显示溢出的内容,而移动we ...

  2. 【转】移动web页面支持弹性滚动的3个方案

    传统 pc 端中,子容器高度超出父容器高度,通常使用 overflow:auto 可出现滚动条拖动显示溢出的内容,而移动web开发中,由于浏览器厂商的系统不同.版本不同,导致有部分机型不支持对弹性滚动 ...

  3. IOS苹果手机上 iframe 滚动失效条问题,局部滚动开启弹性滚动!

    html:bo<div class="scroll-wrapper"> <iframe src=""></iframe> & ...

  4. 移动web页面支持弹性滚动的3个方案

    有段时间一直折腾移动端页面弹性滚动的各种问题,做了点研究,今天做个小分享~ 传统 pc 端中,子容器高度超出父容器高度,通常使用 overflow:auto 可出现滚动条拖动显示溢出的内容,而移动we ...

  5. 页面在Native端滚动时模拟原生的弹性滚动效果

    width: 100%;overflow: scroll;overflow-y: hidden;-webkit-overflow-scrolling: touch;   ---- 对应的滚动内容内添加 ...

  6. flex上下固定中间滚动布局

    传统 pc 端中,子容器高度超出父容器高度,通常使用 overflow:auto 可出现滚动条拖动显示溢出的内容,而移动web开发中,由于浏览器厂商的系统不同.版本不同,导致有部分机型不支持对弹性滚动 ...

  7. -webkit-overflow-scrolling : touch;快速滚动标签

    http://www.cnblogs.com/PeunZhang/p/3553020.html(链接出处,只是转载学习) 对于如何使用弹性滚动,这里并没有最好的方案,具体看产品的用户群.产品的定位等, ...

  8. IOS设备上网页中的页面滚动效果模拟

    可能咋一看不知道我说的是个啥,因为iOS本来就用这功能的啊,还模拟它干啥?先听我说下项目背景哈 我现在开发的是一个webapp,主要是用在ipad上,这个app的大小是固定大小的,为了防止触摸它出现弹 ...

  9. dom内容区域的滚动overflow,scroll

    去掉手机上点击点中的默认高亮效果 -webkit-tap-highlight-color: rgba(0,0,0,0); ios手动启动一下监听touch事件以响应css伪类: document.ad ...

随机推荐

  1. C/C++ 关于大小端模式

    大端模式:  数据的高字节存在低地址  数据的低字节存在高地址 小端模式:  数据的高字节存在高地址  数据的低字节存在低地址 如图,i为int类型占4个字节,但只有1个字节的值为1,另外3个字节值为 ...

  2. EXCLE使用宏生成目录

    宏代码: Sub mu() Dim i As Integer Dim ShtCount As Integer Dim SelectionCell As Range ShtCount = Workshe ...

  3. Percona-Xtrabackup 2.3.3 慢查询依旧堵塞MariaDB备份(三)

    MariaDB [yoon]> select version();+---------------------+| version() |+---------------------+| 10. ...

  4. Binder相关

    Binder分析 需了解C/S还有管理这些的ServiceManager. 简单来讲你(client)有个包裹(parcel)让快递员(proxy)送到公司(server),   公司(server) ...

  5. hdu 3371 Connect the Cities

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=3371 Connect the Cities Description In 2100, since th ...

  6. C#类型的转换:Converter<TInput, TOutput> 委托的使用

    Converter<TInput, TOutput> 委托 表示将对象从一种类型转换为另一种类型的方法. 此委托由 Array 类的 ConvertAll<TInput, TOutp ...

  7. Asp.NET网站Session浅谈

    .NET网站在Web.config的<configuration>下<system.web>下<sessionState>配置session. sessionSta ...

  8. Labview实现脉波调制( PAM )

    Labview实现脉波调制( PAM ) 根据定义为脉冲振幅调制 生成一个正弦信号,得到其幅值输入给一个方波信号的幅值 这个等价于一个方波信号和一个正弦信号相乘 得到的PAM信号通过观察其频率可以发现 ...

  9. Photoshop/PS中如何写维吾尔语等语言 乱码

    在新疆的朋友都了解很多标语上面都会有汉语.维语等两种语言.有很多维吾尔语.哈萨克语.柯尔克孜语等语言 要在PS 里进行设计处理,这时在Photoshop中进行设计时文字粘贴进来后出现不正常是乱码形式. ...

  10. 多线程 -- GCD

    GCD中有2个核心概念 任务:执行什么操作 队列:用来存放任务 执行任务 同步方法: dispatch_sync dispatch_sync(dispatch_queue_t queue, dispa ...