Go to Project -> Target , Then set Status Bar Style to Light . It makes status-bar white from the launch screen. Then set View controller-based status bar appearance equal to NO in Info.
Go to the Storyboard. Select the View and in the Attributes Inspector change the Background Color to Light Gray. Build and Run the Project. The default style of the status bar is dark content.
Step 1: After opening the android studio and creating a new project with an empty activity. Step 2: Navigate to res/values/colors. xml, and add a color that you want to change for the status bar.
The style of the status bar can be changed to a status bar with white content. Go to the ViewController. swift file and add the following lines of code. The preferredStatusBarStyle property is set to lightContent.
If you want to change Status Bar Style from the launch screen, You should take this way.
Go to Project
-> Target
,
Set Status Bar Style
to Light
Set View controller-based status bar appearance
to NO
in Info.plist
.
Using a UINavigationController
and setting its navigation bar's barStyle
to .Black
. past this line in your AppDelegate.m
file.
navigationController.navigationBar.barStyle = UIBarStyleBlack;
If you are not using UINavigationController
then add following code in your ViewController.m
file.
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
And call the method to this line :
[self setNeedsStatusBarAppearanceUpdate];
First set
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
Go to your AppDelegate, find itsdidFinishLaunchingWithOptions
method and do:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}
and then set View controller-based status bar appearance
equal to NO in plist.
Add a key in your info.plist
file UIViewControllerBasedStatusBarAppearance
and set it to YES
.
In viewDidLoad method of your ViewController add a method call:
[self setNeedsStatusBarAppearanceUpdate];
Then paste the following method in viewController
file:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With