
- iOS Tutorial
- iOS - Home
- iOS - Getting Started
- iOS - Environment Setup
- iOS - Objective-C Basics
- iOS - First iPhone Application
- iOS - Actions and Outlets
- iOS - Delegates
- iOS - UI Elements
- iOS - Accelerometer
- iOS - Universal Applications
- iOS - Camera Management
- iOS - Location Handling
- iOS - SQLite Database
- iOS - Sending Email
- iOS - Audio & Video
- iOS - File Handling
- iOS - Accessing Maps
- iOS - In-App Purchase
- iOS - iAd Integration
- iOS - GameKit
- iOS - Storyboards
- iOS - Auto Layouts
- iOS - Twitter & Facebook
- iOS - Memory Management
- iOS - Application Debugging
- iOS Useful Resources
- iOS - Quick Guide
- iOS - Useful Resources
- iOS - Discussion
iOS - Status Bar
Use of Status Bar
Status bar displays the key information of device like −
- Device model or network provider
- Network strength
- Battery information
- Time
Status bar is shown below.

Method that Hides Status Bar
[[UIApplication sharedApplication] setStatusBarHidden:YES];
Alternate Way to Hide Status Bar
We can also hide the status bar with the help of info.plist by adding a row and selecting UIStatusBarHidden and make its value to NO.
Add a Custom Method hideStatusbar to our Class
It hides the status bar animated and also resize our view to occupy the statusbar space.
-(void)hideStatusbar { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; [UIView beginAnimations:@"Statusbar hide" context:nil]; [UIView setAnimationDuration:0.5]; [self.view setFrame:CGRectMake(0, 0, 320, 480)]; [UIView commitAnimations]; }
Update viewDidLoad in ViewController.m as follows −
- (void)viewDidLoad { [super viewDidLoad]; // The method hideStatusbar called after 2 seconds [self performSelector:@selector(hideStatusbar) withObject:nil afterDelay:2.0]; // Do any additional setup after loading the view, typically from a nib. }
Initial output and output after 2 seconds −

ios_ui_elements.htm
Advertisements