Hiding status bar while displaying splash screen in PhoneGap iOS application

Introduction: Most of the iOS application starts with the splash screen with the spinner which makes the sense that application is loading it’s required files and resources. But if you focus on the screen, you will find that while showing the splash screen, some part of the splash screen is hidden by the status bar.

Description: If we want to hide the status bar while showing the splash screen, it is very easy and we can view the splash screen completely by ignoring the staus bar above it.

Here is the the simple technique bellow.

1. Open Xcode and click on the project in Project Navigator.

2. In the target panel select the project and it will open the project details.

3. Choose the general tab form the list and we can find the Development Info panel in the list. And in Development Info there will be an option for Status Bar Style.

4. Then we need to tick the check box for “Hide during application launch”.

Image

Now when you launch your application the status bar will automatically hide while showing the splash screen. But it will also hide the status bar through out the application. ie even after launching the application completely.

So there is a good way by which we can again display the status bar when our application is ready.

1. Open the MainViewController.m file form the Classes folder.

2. There we can find the viewDidLoad method.

3. Just add this line [[UIApplication sharedApplication] setStatusBarHidden:NO]; inside the viewDidLoad method.

Image

Now we are done, so when we launch our application there will be no status bar while showing splash screen and again status bar will reappear when application is completely ready and we are in Home screen.

Summary: So we learn that how to hide the status bar while displaying the splash screen and again display the status bar after application is completely ready.

Written By: Sourabha Kumar Sahoo, Software Developer, Mindfire Solutions

Advertisements

3 thoughts on “Hiding status bar while displaying splash screen in PhoneGap iOS application

  1. Pingback: Hiding status bar while displaying splash screen in PhoneGap iOS application | souravsahoo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s