- (void) scrollViewDidScroll:(UIScrollView *)scrollView{ CGPoint offset = scrollView.contentOffset; // 当前滚动位移 CGRect bounds = scrollView.bounds...
分类:
其他好文 时间:
2014-08-05 15:32:49
阅读次数:
207
判断scrollView有没有滚动到视图的底部,用来判断下拉刷新的时间。等 - (void)scrollViewDidScroll:(UIScrollView *)scrollView1 { CGPoint offset = scrollView1.contentOffset; ...
分类:
移动开发 时间:
2014-08-05 13:30:39
阅读次数:
226
contentOffset默认CGPointZero,用来设置scrollView的滚动偏移量。//设置scrollView的滚动偏移量 scrollView.contentOffset=CGPointMake(0,200);contentSize默认CGSizeZero,用来设置scrollVie...
分类:
其他好文 时间:
2014-08-05 00:18:38
阅读次数:
212
如图红色为scrollview的背景色,在scrollview上加了图片之后,总会有向下的偏移
设置contentOffset也不管用
在ios7中controller有个automaticallyAdjustsScrollViewInsets属性,默认为YES
if (iOS7&&[self respondsToSelector:@selector(automaticall...
分类:
移动开发 时间:
2014-08-01 16:07:31
阅读次数:
242
contentSize是scrollview可以滚动的区域,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960),代表你的scrollview可以上下滚动,滚动区域为frame大小的两倍。contentOffset是scrollview当前显示区域顶...
分类:
其他好文 时间:
2014-07-19 15:11:28
阅读次数:
236
contentSize:The size of the content view. 其实就是scrollview可以滚动的区域,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960),代表你的scrollview可以上下滚动,滚动区域为frame大小的...
分类:
其他好文 时间:
2014-07-19 09:03:08
阅读次数:
203
这几个都是在ios程序中,经常会注意到的一些小细节,能否真正了解这些,对写ios程序也有很大的好处。frame 是UIView中表示此view的一个矩形面积,包括了view在它的superview中的一些几何上的标识。有起始坐标,也就是origin(CGPoint)和这个矩形面积的宽(width)和...
分类:
其他好文 时间:
2014-06-24 18:07:33
阅读次数:
171
简单思路:实例一个UIScrollView,在scrollView上添加两个UIView, 为scrollView添加观察者,观察scrollView的contentOffset属性.当偏移量改变时,改变UIView视图的坐标.示例代码:@interface RootViewController (...
分类:
其他好文 时间:
2014-06-24 13:35:15
阅读次数:
297
很常用的一个功能,就记录下来了。-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { historyY = scrollView.contentOffset.y;}-(void)scrollViewDidScroll:(...
分类:
其他好文 时间:
2014-06-23 00:38:34
阅读次数:
204
scrollView:1. 介绍scrollView一些属性
1>.要想使用scrollView必须做两件事 1).设置scrollView内容 2).设置contentSize (滚动范围) 2>.其他属性
1). contentOffset(滚动位置) ...
分类:
移动开发 时间:
2014-06-10 08:59:52
阅读次数:
347