zoukankan      html  css  js  c++  java
  • UIScrollerView常见属性

    CGSize contentSize :设置UIScrollView的滚动范围

    CGPoint contentOffset :UIScrollView当前滚动的位置

    UIEdgeInsets contentInset :这个属性可以在四周增加滚动范围

    BOOL bounces 是否有弹簧效果

    BOOL scrollEnabled 是否能滚动

    BOOL showsHorizontalScrollIndicator 是否显示水平方向的滚动条

    BOOL showsVerticalScrollIndicator     是否显示垂直方向的滚动条

    UIScrollViewIndicatorStyle indicatorStyle  设定滚动条的样式

    BOOL dragging 是否正在被拖拽

    BOOL tracking  当touch后还没有拖动的时候值是YES,否则NO

    BOOL decelerating 是否正在减速

    BOOL zooming 是否正在缩放

     
     
     
    滑动速度加快
    这里是手指离开屏幕后的滑动初始值设置, 
    void ScrollView::endRecordSlidAction() 
         
        float orSpeed = MIN(fabs(totalDis)/(_slidTime), AUTOSCROLLMAXSPEED); 
            //startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, true, -1000); 
        startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed*2, true, -500); //orSpeed是初始速度,-500是加速度 
     
    滚动个tableView时控制速度
     [self.tableView scrollToRowAtIndexPath:indexPath
                              atScrollPosition:UITableViewScrollPositionTop
                                      animated:YES];
    但是滚动的非常快,我想让速度慢一点
      [UIView animateWithDuration:2 animations:^{
          [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForItem:20 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];
        }
      ];
  • 相关阅读:
    Python使用print打印时,展示内容不换行
    二进制、八进制、十进制和十六进制的相互转化(图解)
    IDEA 配置背景颜色(豆沙绿)
    Linux下脚本文件第一行的作用
    IDEA 注释模板配置
    IDE 常用配置
    Python 运算符
    Python 基础
    Chrome 浏览器快捷键
    正则表达式
  • 原文地址:https://www.cnblogs.com/walkingzmz/p/5309684.html
Copyright © 2011-2022 走看看