自动布局只是不工作对每个屏幕尺寸 [英] Autolayout just not working for every screen size

查看:139
本文介绍了自动布局只是不工作对每个屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是一个游戏,菜单有很多标签和按钮,我不能让所有不同的屏幕尺寸(iPhone 4/5/6月6日+)把目光从同一个约束集可以接受的。

My app is a game and the menus have many labels and buttons and I cannot get all of the different screen sizes(iPhone 4/5/6/6+) to look acceptable from the same set of constraints.

有没有使用到所有的意见一起同步看起来相同的所有不同屏幕尺寸的方法吗?

Is there a way that you use to synchronize all the views together to look the same on all different screen sizes?

该项目已被锁定为唯一的画像,所以我不需要考虑轮换。

The project is locked to only portrait so I don't need to consider rotation.

推荐答案

有关自动布局,您


  1. 考虑要支持的屏幕尺寸。

  2. 查看/按键/标签/ ImageView的等你要哪,而在保持固定
    不同的屏幕尺寸。

  3. 的视图/按键/标签/ ImageView的等,可以进行调整以适合屏幕。

现在,如果通过扩展可以适合在屏幕上的东西,那么你是好去。但是,如果你仍然无法找到的方式,那么你就可能需要使用滚动视图,并添加一个UIView(我们称之为内容视图),它把所有的东西在里面,并从顶部垂直约束他们一路底部。该视频可以帮助你,如果你想使用滚动型
https://www.youtube.com/watch?v=UnQsFlMGDsI

Now if by scaling the things you can fit on the screen then you are good to go. But if you still can't find way then you would probably need to you use scrollview and and add a UIView (let's call it content view) to it put your all stuff in it and constraint them vertically all the way from top to bottom.This video can help you if you want to use scrollview https://www.youtube.com/watch?v=UnQsFlMGDsI

这篇关于自动布局只是不工作对每个屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆