"view.superview.bounds = view.bounds" 是什么意思
What's the meaning of "view.superview.bounds = view.bounds"
我用的是第三方代码,这段代码有这么一段:
view.superview.bounds = view.bounds
我不知道这是什么意思?
你能帮帮我吗?
view
是您当前的观点。
view.superview
是 currentView 的父视图。
The bounds rectangle, which describes the view’s location and size in its own coordinate system
所以这意味着您当前视图的边界正在分配给它的父视图边界。完成此分配后,两个视图大小相同。
这是一个很好的例子:
我用的是第三方代码,这段代码有这么一段: view.superview.bounds = view.bounds
我不知道这是什么意思?
你能帮帮我吗?
view
是您当前的观点。
view.superview
是 currentView 的父视图。
The bounds rectangle, which describes the view’s location and size in its own coordinate system
所以这意味着您当前视图的边界正在分配给它的父视图边界。完成此分配后,两个视图大小相同。
这是一个很好的例子: