简体   繁体   中英

Autosizing relative to content view, not superview?

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM