frame 与 bounds 的区别与关系

来源:互联网 发布:js 全局命名空间 编辑:程序博客网 时间:2024/05/22 07:02

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);}
本文原始链接:http://unmi.cc/ios-bounds-frame, 来自:隔叶黄莺 Unmi Blog


本文链接 http://unmi.cc/ios-bounds-frame, 来自 隔叶黄莺 Unmi Blog

0 0
原创粉丝点击