简体   繁体   English

当我从iPhone启动图像移动到与UIView背景相同的图像时,为什么在顶部引入了页边空白?

[英]why is there a margin introduced at the top as I move from iPhone startup image to same image as background on UIView?

why is there a margin introduced as I move from iPhone startup image to same image as background on UIView? 当我从iPhone启动图像移动到与UIView背景相同的图像时,为什么会引入页边空白?

So I have: 所以我有:

  • image used for background/startup on iPhone, it's size is: 320 x 480 用于iPhone上的背景/启动的图像,它的大小是:320 x 480
  • after startup I have a UIView that displays the same image (idea is not to have any difference the user can see when transisiton from start up image to the UIView background image) 启动后,我有一个显示相同图像的UIView(从启动图像到UIView背景图像的转换过程中,用户看不到的任何想法)
  • the first view is "inside" a UINavigationController, however I set the MenuBar and Toolbar to hidden 第一个视图在UINavigationController的“内部”,但是我将MenuBar和Toolbar设置为隐藏

There is however blank grey margin introduced at the top of the screen, between the signal strength bar and the top of the background image? 但是,在屏幕顶部,信号强度条和背景图像顶部之间是否有空白的灰色边距? The height of this grey margin I wasn't expecting looks to be about the height of the top signal strength bar. 我没想到的灰度余量的高度大约是顶部信号强度条的高度。 So this margin/bar effectively drops the background image downwards... 因此,此边距/栏有效地将背景图像向下降低...

How can I remove this? 我该如何删除?

Before (ie iPhone startup image) : 之前(即iPhone启动映像)

在此处输入图片说明

After (background image of first view) : 之后(第一张视图的背景图片)

在此处输入图片说明

Your launch image contains an imitation of the status bar. 您的启动映像包含状态栏的模仿。 The launch image takes up the whole 320x480, but the background image is placed at the top of the main view which is below the status bar. 启动图像占据了整个320x480,但背景图像位于状态栏下方主视图的顶部。 So you can see the imitation status bar still. 这样您仍然可以看到模仿状态栏。

Just decrease the y of the background image view to -20. 只需将背景图片视图的y减小到-20。

found two things required to fix it: 找到了修复它所需的两件事:

  1. setting the View Mode to "bottom" and 将查看模式设置为“底部”,然后
  2. found the imageview was slightly off positioned within the XIB designer itself 发现imageview在XIB设计器中的位置略有偏离

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

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