设置 scrollview
三个属性
CGPoint contentOffset;
CGSize contentSize;
UIEdgeInsets contentInset;
//设置 scrollview 在屏幕上显示的大小
self.scrollView=[[UIScrollViewalloc]
initWithFrame:CGRectMake(0,0,
SCREEN_WIDTH,SCREEN_HEIGHT-70)];
//contentsize 是设置 scrollview 总共的滚动长度
self.scrollView.contentSize=CGSizeMake(SCREEN_WIDTH, 10000);
//contentOffset 设置内容的偏移量 scrollview 滚动后,和起始位置的差量值
contentInset :The distance that the content view is inset from the enclosing scroll view.
即 显示内容在 scrollview 中(frame)的位置 上下左右 距离 frame 的大小
单位 UIEdgeInsets
-
typedef struct {
-
CGFloat top, left, bottom, right;
-
}
|