Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在某些 UIView 中找出某些子控件的右坐标或下坐标?对控件的最右侧 x 坐标执行此操作的一种方法是添加控件的frame.size.width+ frame.origin.x。
frame.size.width
frame.origin.x
我想我在某处读过这个值可以作为属性使用,不确定在哪里,也许在某些框架中..
你可以使用CGRectGetMaxX(view.frame),CGRectGetMaxY(view.frame)
CGRectGetMaxX(view.frame)
CGRectGetMaxY(view.frame)
要获得右下坐标,您还可以使用 Core Graphics 方法,例如
CGRectGetMinX and CGRectGetMinY .. etc