Segment 滑动
来源:互联网 发布:mac pro截屏快捷键 编辑:程序博客网 时间:2024/06/07 18:32
- (void)lineViewScrollToIndex:(NSInteger)index { [UIView animateWithDuration:0.3 animations:^{ self.lineView.x = index*self.lineView.width; }completion:^(BOOL finished) { CGPoint point = self.baseScrollView.contentOffset; CGPoint lineViewToSelfPoint = [self.lineView.superview convertPoint:self.lineView.center toView:self]; //把当前的滑动到中心点的距离 CGFloat toScrollViewCenter = lineViewToSelfPoint.x - self.center.x; if (toScrollViewCenter <0) {//要向右边滑动contentOffset.x >=0 // 这里表示scrollView向右滑动 point.x += toScrollViewCenter; // 但是向右滑动不能小于0,否则将会出现第一个 也向右偏移 if (point.x <0) { point.x = 0; } }else {//向左滑动 contentOffset.x <= relationValue //这里表示向左滑动 //这个是最大的偏移X量 CGFloat maxOffX = self.baseScrollView.contentSize.width - self.baseScrollView.width; point.x += toScrollViewCenter; // 如果向左滑动超出了它的最大偏移量 if (point.x>maxOffX) { point.x = maxOffX; } } [self.baseScrollView setContentOffset:point animated:YES]; }];}
0 0
- Segment 滑动
- iOS Segment+页面滑动
- iOS Segment带滑动条切换效果
- Ionic2 可以左右滑动的Segment
- segment
- Segment
- Segment
- Segment
- Segment
- segment
- Segment Register
- word segment
- segment register
- rollback segment
- Segment Advisor
- segment fault
- Segment tree
- bss segment
- MySQL 数据库字符集
- 结构型:设计模式之享元模式(八)
- IOS学习之IOS沙盒(sandbox)机制和文件操作
- WPF查找外部样式
- MySQL的lock tables和unlock tables的用法
- Segment 滑动
- JSONObject、JSONArray
- 音频混音算法的实现
- 【Unity3D】浅谈Vector3的点积与叉积
- 深度学习系列(七):自编码网络与PCA特征学习的分类对比实验
- leetcode:190 Reverse Bits-每日编程第三十二题
- 【Linux】让Apache中php的url不再区分大小写
- Windows socket-五种I/O模型
- Softmax