如何使用自动布局为通用应用程序调整UIView的大小 [英] How to Resize UIView for universal application using Autolayout
问题描述
我做了一个嵌入了UIView的UIView.我使用约束条件来获得一个不错的UIView,但是即使结果正常,它也无法按照我想要的方式工作.
I did a UIView with UIView embedded inside. I used constraints to get a decent UIView but it is not yet working the way I want even though the result is okay.
我希望获得与iPhone 4.7英寸到iPhone 5.5英寸和4英寸相同的结果.
I would like to get the same results I have on the iPhone 4.7 inch into the iPhone 5.5 inch and the 4 inch.
为此,我认为我需要调整blue UIViews
的大小,但是我不知道如何使它们从storyboard
或以编程方式自动调整大小.我记得很久以前,我是为Android应用程序做的,这很容易,我只需要给出% bigger or lower
.
For that, I think I need to resize the blue UIViews
but I have no clue how to make them auto resize from storyboard
nor programmaticaly. I remember a long time ago, I did it for an Android Application and it was easy, I just needed to give a % bigger or lower
.
有没有办法在iOS上做到这一点?
Is there a way to do it with iOS ?
推荐答案
如果这些是UIViews
.然后,您可以执行以下操作:
If These are UIViews
. Then you can do the following:
- 一次选择所有视图:
尝试一下.让我知道是否出现问题.
Try this. And let me know if some issue arise.
希望这会有所帮助.
这篇关于如何使用自动布局为通用应用程序调整UIView的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!