scrollview 的使用

设置 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

  1. typedef struct {  
  2.     CGFloat top, left, bottom, right;  
  3. }




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值