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.
我有两个UIViews,我需要绘制一个矩形(或)在两个UIViews. 我怎样才能得到这个?
UIView
UIViews
您可以使用:
CGRect smallestRectangle = CGRectUnion(view1.frame, view2.frame);
根据文档,此功能
返回包含两个源矩形的最小矩形。
这里有一些步骤应该可以找到你想要的矩形