问题描述
我的超级视图中有一个 UIView.我已经设置了一些约束.现在我希望不同设备上的视图大小应该不同.如果我设置了固定宽度 &高度然后我得到错误的结果.我尝试使用用户纵横比,但这会使多个设备上的视图太大或太小.
I have a UIView in my super view.I have set it some constraints.Now I want the size of view should be different on different devices.If I set the fix width & height then I get the wrong result.I have tried to user aspect ratio but that make a view too big or too small on multiple devices.
我想要身高&宽度应该以相同的比例增加,它必须在所有设备上看起来都一样.我想要灵活的视图高度和宽度.请告诉如何做到这一点?
I want the height & width should increase in equal proportion that it must look same all devices.I want to have flexible height and width of the view.Please tell how to do this?
这是图片
提前致谢
推荐答案
使用大小类.它有助于为不同的设备进行不同的设置.http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorialhttps://youtu.be/IwSTXY0awng?t=2m12s
Use Size Classes. It helps to have different settings for different devices.http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorialhttps://youtu.be/IwSTXY0awng?t=2m12s
这篇关于如何设置动态宽度&iOS自动布局中视图的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!