使用应用程序时,Interface Builder 中 UIView 对象的大小会发生变化 [英] Size of UIView object in Interface Builder changes when using the app

查看:24
本文介绍了使用应用程序时,Interface Builder 中 UIView 对象的大小会发生变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个额外的 UIView 对象,我只是将它拖到故事板上.它覆盖了整个 iPhone 屏幕.所以我点击它并拖动它直到它只覆盖了 iPhone 屏幕的一半.

I have an extra UIView object that I just dragged onto the storyboard. It covers the entire iPhone screen. So I clicked on it and dragged it until it only covered half of the iPhone screen.

这是我的故事板在选择了额外的 UIView 对象后的样子:

This is what my storyboard looks like with my extra UIView object selected:

但是,当我在 iPhone 上实际使用该应用程序时,UIView 小得多,甚至不占屏幕的一半(这是其中包含 stackoverflow 站点图像的正方形):

However, when I actually use the app on my iPhone, the UIView is much smaller and doesn't even take up half of the screen(It's the square with the stackoverflow site image inside of it):

当我实际运行该应用程序时,如何使其不变小?运行应用程序时,我希望 UIView 对象的大小与 xcode 中故事板上的大小相同.

How can I keep it from being smaller when I actually run the app? When running the app, I want the UIView object to be the same size as it is on the storyboard in xcode.

感谢您的帮助.

推荐答案

您必须选择了自动布局.取消选中它,问题就解决了.

You must have selected Autolayout. Uncheck it and problem is resolved.

这篇关于使用应用程序时,Interface Builder 中 UIView 对象的大小会发生变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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