布局问题,启用了自动布局,但似乎不起作用 [英] Layout issue, Autolayout enabled but doesn't seem to work

查看:138
本文介绍了布局问题,启用了自动布局,但似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone 6模拟器上运行时,以下是我的应用程序

Below is my app when run on iPhone 6 simulator

您可能已经猜到它在iPhone 5上看起来不错.

As you might have guessed it looks good on iPhone 5.

自动调整大小功能已启用,但是我不确定我是否完全掌握了这个概念,因此我可能会遗漏一些东西.

Autoresize is on, but I'm not sure i fully grasp the concept, so i might be missing something.

对于解决方案的任何建议,我们将不胜感激. 我还为情节提要结构添加了另一张图片.

Any suggestions for a solution are appreciated. I also added another image for the storyboard structure.

推荐答案

自动布局是 on ,但是您不是使用.您需要添加约束,以便在调整主视图的大小以适合屏幕时,表视图也随之调整大小.否则,它将保持与设计时相同的尺寸(恰好是iPhone 5的正确尺寸).这些设备的尺寸不同;自动布局的想法就是要解决这种差异.使用它.

Auto layout is on but you are not using it. You need to add constraints so that when the main view is resized to fit the screen, the table view is resized along with it. Otherwise, it just stays at the same size you designed it (which happens to be the right size for an iPhone 5). These devices are different sizes; the idea of auto layout is to cope with that difference. Use it.

这篇关于布局问题,启用了自动布局,但似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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