How do I start the app full screen default.png (picture)?

Source: Internet
Author: User

Most apps display a background image in full screen during startup, such as Sina Weibo showing this one:

To achieve this in iOS, no pressure, very simple, the need to display the full-screen image default.png, the iOS app will be launched by default to load and full-screen display default.png.

You can also name pictures with other names, and configure them in Info.plist:

Once configured, the app will load and display full screen when it starts lufy.png

By default, the app is not really "full screen" when the default.png is displayed, because the top status bar is not hidden, such as the following effect:

In most cases, we want to hide the status bar so that the default.png is really full screen.

When it comes to this, someone might immediately think of a way: Add the following code to the Appdelegate application:didfinishlaunchingwithoptions: Method:

I can only say that your thinking is right, but actually do not achieve the desired effect, you will find the display default.png when the status bar is still there, and so on default.png display, the status bar is hidden.

Let me explain why this method is not feasible, in fact the reason is very simple:

1> Default.png is loaded during app startup, not after the app is launched

2> appdelegate Application:didfinishlaunchingwithoptions: The method is called after the app has been started.

Here's a solution to add a configuration to the Info.plist:

The yes here indicates that the status bar is hidden when the app is initialized (launched).

Of course, the status bar is still hidden after the default.png is displayed. If you want to re-display the status bar, fill in the following code:

[UIApplication Sharedapplication].statusbarhidden = NO;

How do I start the app full screen default.png (picture)?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.