bounds和frame关系与区别?

UIView的这两个属性有什么区别?
2025-05-21 05:13:39
推荐回答(2个)
回答1:

坐标系不同。bounds是自己坐标系,rect中的origin一般都是(0,0)开始的。frame是父坐标系,rect中的origin就是指的在父系中的开始点。

回答2:

参考: http://www.devdiv.com/ios_frame_bounds_-blog-6399-51310.html