iOS中的自动布局和自动调整大小之间的基本区别是什么 [英] What is the basic difference between Auto Layout and Auto Resizing in iOS
问题描述
我一直在寻找自动布局和自动调整大小之间的正确区别,但无法找到确切的答案。我可以在哪里使用自动布局和应用程序中的自动调整大小?任何帮助都将成为感谢的一部分。
I have been searching the proper difference between Auto Layout and Auto Resizing, but didn't able to find the exact answer. Where I can use "Auto Layout" and where "Auto Resizing" in app? Any help would be a part of thanks.
推荐答案
Matt Neuberg在他的书:
As Matt Neuberg states in his book:
Autoresizing是一个从概念上分配子视图的问题弹簧
和struts。弹簧可以伸展;一个支柱不能。弹簧和支柱
可以在内部或外部分配。因此,您可以指定(使用
内部弹簧和struts)视图是否以及如何调整大小,
和(使用外部弹簧和支柱)视图是否以及如何重新定位
。 / p>
Autoresizing is a matter of conceptually assigning a subview "springs and struts." A spring can stretch; a strut can’t. Springs and struts can be assigned internally or externally. Thus you can specify (using internal springs and struts) whether and how the view can be resized, and (using external springs and struts) whether and how the view can be repositioned.
和
Autolayout,取决于观点的限制。约束(NSLayoutConstraint的
实例)比
autoresizingMask复杂得多,它是一个具有数值的完整对象,
可以描述任意两个视图之间的关系(不是只是一个子视图
及其超级视图)。
Autolayout, depends on the constraints of views. A constraint (an instance of NSLayoutConstraint) is much more sophisticated than the "autoresizingMask" it’s a full-fledged object with numeric values, and can describe a relationship between any two views (not just a subview and its superview).
这篇关于iOS中的自动布局和自动调整大小之间的基本区别是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!