Background image of iPhone app is not showing perf

2019-08-28 23:14发布

This question already has an answer here:

I want to set background image of my iPhone app. I've created 3 dimensions images

  1. 320 * 480
  2. 640 * 960
  3. 640 * 1136

But when i set background then whole image is not showing. I mean width of the image is showing perfectly but height is not showing. 90% height is only showing in simulator and my iPhone.

I don't know what is the reason. I am new in iPhone. Please help me.

Thanks!
Shailesh

2条回答
聊天终结者
2楼-- · 2019-08-28 23:22

You need to allow for the status bar which is 20px. You could also turn off the status bar, but that is not recommended.

If you want the status bar to hidden, you need to set the UIStatusBarHidden property to true in your info.plist file.

<key>UIStatusBarHidden</key>
<true/>

That takes care of the status bar when the app is launching. If you also want it invisible after launch, then you need to call the following code:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
查看更多
对你真心纯属浪费
3楼-- · 2019-08-28 23:42

You forgot you have a status bar, witch has 20 px. Also, if you are using a UINavigationBar, this one its 44px . See Some Examples:

**only with statusBar (20 px)

size background:

  1. -iPhone 3gs: 320x460
  2. -iPhone 4/4s : 640x920 (retina display)
  3. -iPhone 5 : 640x1116 (retina display)

**status bar + UINavigationBar (20px + 44 px)

size background:

  1. -iPhone 3gs : 320x416
  2. -iPhone 4/4s : 640x876 (retina display)
  3. -iPhone 5 : 640x1072

you should check this link: size screen iPhone

查看更多
登录 后发表回答