简体   繁体   English

UIImage在UIImageView中显示不正确

[英]UIImage displaying incorrectly in a UIImageView

I have an XIB file that looks like this: 我有一个如下所示的XIB文件:

XIB屏幕截图

As you can see I have a UIImageView at the bottom of the view, note its all contained within the view. 如您所见,我在视图底部有一个UIImageView,请注意它全部包含在视图中。

However, when I run the code which places a UIImage in the view, I get this: 但是,当我运行将UIImage放置在视图中的代码时,得到以下信息:

跑步

Here is the image I am trying to display: 这是我要显示的图像:

Image 图片

Why does it go off the bottom of the screen? 为什么它不显示在屏幕底部? I've seen similar behaviour in some of my other projects, whats going on? 我在其他一些项目中也看到过类似的情况,这是怎么回事?

Thanks, 谢谢,

Jack 插口

In IB, for the top-level view, for the Simulated User Interface Elements, set the Top Bar to be one of the Navigation Bar options. 在IB中,对于顶层视图,对于“模拟用户界面元素”,将“顶部栏”设置为“导航栏”选项之一。 Understand, you will! 明白了,你会的!

嗨,杰克,您还可以通过界面生成器更改视图大小,例如320&460

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

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