简体   繁体   English

UIImageview从情节提要板在屏幕上的移动位置

[英]UIImageview moving position on screen from storyboard

I have a storyboard with a UIImageView on it. 我有一个带有UIImageView的情节提要。

When I load the app in the emulator the UIImageView has a different position. 当我在模拟器中加载应用程序时,UIImageView处于不同的位置。

What could be causing this? 是什么原因造成的? The only thing I am doing to the UIImageview in the code is making it a subview of another UIImageview. 我对代码中的UIImageview所做的唯一一件事就是使其成为另一个UIImageview的子视图。

It is possible that your storyboard is for the iPhone 5 and not for the iPhone 4 screen. 您的情节提要可能适用于iPhone 5,而不适用于iPhone 4屏幕。

You can turn this off by clicking on the icon at the bottom of the storyboard screen. 您可以通过单击情节提要屏幕底部的图标将其关闭。 It's the left icon in the icon group. 它是图标组中的左侧图标。

Hope that it's the answer on your question 希望这是您的问题的答案

Are you using Autolayout ? 您在使用自动版式吗? If not , then probably your struts and springs of the UIImageView are not set correctly causing the ImageView to change position. 如果不是,则可能是您的UIImageView的支柱和弹簧未正确设置,从而导致ImageView更改了位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM