【代碼筆記】iOS-ios7 StatusBar,ios-ios7statusbar
代碼:
RootViewController.m
#import "RootViewController.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self;}- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. self.title=@"UIStatus"; //動畫效果 [UIView animateWithDuration:3 animations:^{ [self setNeedsStatusBarAppearanceUpdate]; }];}- (void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}#pragma mark IOS 7 UIStatusBar//動畫效果-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation{ return UIStatusBarAnimationFade;}//樣式-(UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleDefault;}//顯示和隱藏-(BOOL)prefersStatusBarHidden{ return FALSE;}@end