滚动视图大小与 xcode 中的设备屏幕不匹配 [英] Scroll View Size not match with the device screen in xcode

查看:26
本文介绍了滚动视图大小与 xcode 中的设备屏幕不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我尝试了带有多个按钮的页面,但所有按钮都无法显示在一个屏幕中.所以,我创建了滚动视图和视图,然后将所有按钮放在视图中.故事板看起来不错.其他设备如 iPhone 5 和 5S 看起来不错,但是当我尝试 6 和 6 plus 时,滚动视图的大小不正确.我不知道出了什么问题.

Ok, I tried the page with several buttons but all of them will not fit in one screen. So, I create the scroll view and the view and then put all of buttons inside the view. The storyboard look fine. Other devices such as iPhone 5 and 5S look fine but when I tried 6 and 6 plus, the size of scroll view was incorrect. I couldn't figure what went wrong.

推荐答案

You have to modify constraint for

You have to modify constraint for

  1. scrollview 取消选中约束到所有左右边距底部和顶部为零
  2. 容器视图到超级视图设置队列宽度约束
  3. 容器视图到滚动视图设置水平中心约束.
  4. 每个 UIBUtton 设置了具有恒定高度的顶部/左侧/底部,未设置底部约束.

这篇关于滚动视图大小与 xcode 中的设备屏幕不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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