Change the StatusBar textColor in swift and Objective c iOS
Solution:
Swift:
Swift:
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
The above code will be used to display the lightcontent in the statusBar.
Objective C:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Before implement that above method do the below steps
In info.plist file set the variable UIViewControllerBasedStatusBarAppearance value to YES.
In View Didload add the below code
[self setNeedsStatusBarAppearanceUpdate];
Objective C:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Before implement that above method do the below steps
In info.plist file set the variable UIViewControllerBasedStatusBarAppearance value to YES.
In View Didload add the below code
[self setNeedsStatusBarAppearanceUpdate];
Comments
Post a Comment