问题描述
我有一个视图:
有人可以帮我布置这些视图,使它们在每台iPhone上看起来都一样吗?我的意思是大小是动态的,视图根据屏幕大小而缩小.
我尝试了宽高比和其他布局选项,但没有帮助.
如果要使用自动布局在不同屏幕上更改视图大小,则必须添加高度和宽度约束.然后,它只能更改视图大小./p>
步骤:
-
使用xcode打开您的项目.
-
转到情节提要板中,选择自动布局",选择您的视图,
-
在Xcode中,从编辑器菜单中,选择Pin \ Width和Height
http://www. raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1
I have a view:
Can someone help me to layout these views that they all look the same on every iPhone? I mean size is dynamic and views shrink according to screen size.
I have tried aspect ration and other layout options but none helped.
if you want to change the view sizes on different screens using auto layout ,you have to add the height and width constraints .then only it changes view size.
Steps:
open your project in xcode.
goto storyboard choose Auto layout ,select your view ,
in Xcode From the Editor menu, choose Pin\Width and Height both
http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1
这篇关于自动布局视图在不同的屏幕尺寸上始终具有相同的尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!