本文介绍了(iphone)将子视图的框架设置在超级视图的边界之外?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我可以将子视图放置在Superview的范围之外(部分或全部).
我想知道这是否可以接受,因为在通常的iphone视图编程中这似乎是异常的.

I noticed that I can place subview outside of superview's bound (either partly or fully).
I wonder if that's acceptable, since it seems to be abnormal in usual iphone view programming.

谢谢.

推荐答案

这是可以接受的,有时甚至是惯例-滚动视图或其他复合"视图的自定义实现,例如,通常将对象放置或移动到超视图范围之外

This is acceptable and sometimes even common practice - custom implementations of scroll views or other "composite" views, for example, commonly place or move objects outside the superview's bounds.

您可能对 UIView 属性感兴趣 clipsToBounds ,它将子视图绘图限制为仅超级视图的边界.

You may be interested in the UIView property clipsToBounds, which restricts subview drawing to only the bounds of the superview.

这篇关于(iphone)将子视图的框架设置在超级视图的边界之外?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 15:33