标签:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
UIViewController方法 | 说明 |
- (BOOL)prefersStatusBarHidden NS_AVAILABLE_IOS(7_0); // Defaults to NO | 询问是否隐藏状态栏。 |
- (UIStatusBarStyle)preferredStatusBarStyle NS_AVAILABLE_IOS(7_0); // Defaults to UIStatusBarStyleDefault | 询问状态栏样式(UIStatusBarStyleDefault/UIStatusBarStyleLightContent)。 |
// Override to return the type of animation that should be used for status bar changes for this view controller. This currently only affects changes to prefersStatusBarHidden.
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation NS_AVAILABLE_IOS(7_0); // Defaults to UIStatusBarAnimationFade
|
询问状态栏显示或隐藏动画。 |
// This should be called whenever the return values for the view controller‘s status bar attributes have changed. If it is called from within an animation block, the changes will be animated along with the rest of the animation block.
- (void)setNeedsStatusBarAppearanceUpdate NS_AVAILABLE_IOS(7_0);
|
设置需要更新状态栏。主动调用该方法,将间接调用上述三个方法。如果需要动画生效,需:
[UIView animateWithDuration:0.4
animations:^{ [self setNeedsStatusBarAppearanceUpdate]; }];
|
UIApplication方法/属性 | 说明 |
// Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
@property(nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden;
- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation NS_AVAILABLE_IOS(3_2);
|
设置是否隐藏状态栏。 |
// Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
@property(nonatomic) UIStatusBarStyle statusBarStyle; // default is UIStatusBarStyleDefault
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated;
|
设置状态栏样式(UIStatusBarStyleDefault/UIStatusBarStyleLightContent)。 |
标签:
原文地址:http://www.cnblogs.com/malikun/p/5620166.html