以编程方式自动调整掩码与Interface Builder / xib / nib [英] Autoresizing masks programmatically vs Interface Builder / xib / nib
问题描述
我有一个(可能是假的)假设,启用右边在厦门国际银行利润率指标是等同于使用 UIViewAutoresizingFlexibleLeftMargin
内部代码等等。
所以,我曾经根据想到此快照:
今天晚些时候,我不得不交叉检查,偶然发现 此主题 。
还有苹果文档,标题为标题为自动使用自动调整规则处理布局更改的链接: http://developer.apple.com/library/ios/ #documentation / WindowsViews / Conceptual / ViewPG_iPhoneOS / CreatingViews / CreatingViews.html
所以我现在有一个更新的概念,在我的思维如何设置自动调整掩码编程方式将等同于xib设置:
场景1 :
仅设置(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)
等价于:
在厦门国际银行
情景2 :
设置(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)
中的代码等价于:
在XIB?
我的2个更新的方案是否正确?
div>
是的,Interface Builder在某种意义上(或UIView,取决于你如何看待它)它。您引用的情景是正确的。
I had some confusions, which I think I have resolved them now, but just wanted confirmation.
I was in an (probably false) assumption that enabling the right margin indicator in xib is equivalent to using UIViewAutoresizingFlexibleLeftMargin
inside code and so on.
So, I used to think according to this snapshot:
Later today I had to cross check, and stumbled upon this thread.
And also the apple documentation, entitled with the section with title - "Handling Layout Changes Automatically Using Autoresizing Rules" in this link: http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html
So I now have a renewed concept in my mind as to how setting autoresizing masks programmatically would be equivalent to xib settings:
Scenario 1:
Setting only (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)
is equivalent to:
In XIB?
Scenario 2:
Setting (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin)
in code is equivalent to:
In XIB?
Are my 2 renewed scenarios correct? Am I right now in my understanding?
Thanks, Raj
Yes, Interface Builder has it "reversed" in a sense (or UIView, depending on how you look at it). Your cited "scenarios" are correct.
这篇关于以编程方式自动调整掩码与Interface Builder / xib / nib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!