gpt4 book ai didi

iphone - 两个 UIView 之外的最小矩形 - Objective C

转载 作者:行者123 更新时间:2023-11-28 18:22:37 25 4
gpt4 key购买 nike

我有两个 UIView,我需要绘制一个矩形(或)获取 UIViews 之外的最小矩形的框架。我怎样才能得到这个?

最佳答案

您可以使用:

CGRect smallestRectangle = CGRectUnion(view1.frame, view2.frame);

根据docs , 这个功能

Returns the smallest rectangle that contains the two source rectangles.

关于iphone - 两个 UIView 之外的最小矩形 - Objective C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17319857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com