ScrollView
来源:互联网 发布:2015中国服务贸易数据 编辑:程序博客网 时间:2024/06/06 07:09
滚动视图 ScrollView
属性:
滚动视图可见区域 .frame
内容尺寸 .contentSize= CGSizeMake(sv.bounds.size.width*4, sv.bounds.size.height);
滚动视图套上导航
系统会通过sv.contentInset把高度加64
1.把 sv.contentInset设置一下
sv.contentInset =UIEdgeInsetsMake(-64,0, 0,0);
2.视图中选中控制器
关闭Adjust Scroll View Insets
代码:self.automaticallyAdjustsScrollViewInsets =NO;
TableView和CollectionView也有这个属性
边缘是否弹跳 .bounces
滚动视图整页滚动 .pagingEnabled
水平滚动条是否可见 .showsHorizontalScrollIndicator
方法:
添加子视图
[sv addSubview:imageView];
滚动视图下方圆点 pageControl
属性:
frame .frame
个数.numberOfPages
未选中颜色.pageIndicatorTintColor
被选中颜色 .currentPageIndicatorTintColor
设置某个被选中.currentPage
不能与用户交互 .userInteractionEnabled
图片过半自动是下个点 .currentPage =round(point.x/scrollView.bounds.size.width);
打开ImageView才能与用户交互
.userInteractionEnabled =YES;
- ScrollView
- ScrollView
- scrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- ScrollView
- scrollView
- ScrollView
- ScrollView
- scrollview
- ScrollView
- ScrollView
- scrollView
- ScrollView
- Andorid 实现抢购倒计时能(天时分秒)
- 数据结构.字符串.模式匹配算法
- sed命令n,N,d,D,p,P,h,H,g,G,x解析
- r语言入门系列3
- (一一三)第九章复习题
- ScrollView
- (一一四)第九章编程练习
- 重新出发
- java包用法(课堂)
- view爆炸的烟花效果
- Python数值问题的一些问题
- 图片加载到内存优化
- LayoutTransition 和 SizeChange
- leetcode160---Intersection of Two Linked Lists(交叉点)