相对于内容视图而不是超级视图自动调整大小?
在我的 iPhone 应用程序中,内容视图中有一个 UIView,并且 UIView 中有一些控件。我已经在 Interface Builder 中为这些控件设置了自动调整大小属性,但它们似乎是相对于整个内容视图而不是相对于其超级视图自动调整大小的。然而,它在文档中特别指出,自动调整大小是相对于超级视图而言的。我是否需要做一些特殊的事情才能使我的控件相对于其超级视图而不是整个内容视图自动调整大小?
请帮忙...我已经为此烦恼好几天了。提前致谢!
In my iPhone app, I have a UIView inside the content view, and I have some controls inside the UIView. I've set the autosize properties for these controls in Interface Builder, but it seems that they're getting autosized relative to the whole content view, instead of relative to their superview. However, it specifically says in the documentation that autosize works relative to the superview. Is there something special I have to do to get my controls to be autosized relative to their superview, rather than the entire content view?
Please help... I've been banging my head over this for days. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否确认您的视图层次结构就是您所认为的那样?我时不时地看到过这样的情况:一个视图被放置在 IB 中的另一个视图上,但它实际上并未添加为子视图。
Have you confirmed that your view hierarchy is what you think it is? I've seen cases from time to time when a view was placed over another view in IB, but it was not actually added as a subview.