首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

[转]iOS开发 frame 与 bounds 的差异与关系

2012-08-17 
[转]iOS开发 frame 与 bounds 的区别与关系frame和bounds是UIView中的两个属性(property)。frame指的是:该v

[转]iOS开发 frame 与 bounds 的区别与关系

frame和bounds是UIView中的两个属性(property)。

frame指的是:该view在父view坐标系统中的位置和大小。(参照点是父亲的坐标系统)

bounds指的是:该view在本身坐标系统中 的位置和大小。(参照点是本身坐标系统)

-(CGRect)frame{  return CGRectMake(self.frame.origin.x,self.frame.origin.y,self.frame.size.width,self.frame.size.height);}
-(CGRect)bounds{  return CGRectMake(0,0,self.frame.size.width,self.frame.size.height);}

[转]iOS开发 frame 与 bounds 的差异与关系

[转]iOS开发 frame 与 bounds 的差异与关系

[转]iOS开发 frame 与 bounds 的差异与关系

热点排行