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 list数据类型
    python图形图像处理--验证码的制作
    Java封装、继承和抽象的实例
    C#指定几所城市的天气预报
    我的第一个全站项目纪实
    activiti集成spring
    刷新token并继续之前的请求
    微信小程序开发准备
    zookeeper和dubbo
    zookeeper
  • 原文地址:https://www.cnblogs.com/walkingzmz/p/5309684.html
Copyright © 2011-2022 走看看