开发者

-setStatusBarHidden:animated: is deprecated

At the start of my app, the status bar is hidden, due to the Info.plist setting called Status bar is initially hidden. Later on, I want to show the status bar using:

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];

but I get a warning saying that the function is deprecated. D开发者_如何转开发oes anybody know what the new function is?


setStatusBarHidden:withAnimation: is the new method, which takes a UIStatusBarAnimation instead of a BOOL, so you can choose what animation is used to hide the status bar.


It is:

- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation

See the UIApplication class reference for more info.

If you are trying to write code for both iOS 3.x and iOS 4.x, you are going to run into a further issue that the new method is not available in the old iOS. See this question for further info.


Add this to your AppDelegate.m

    [UIApplication sharedApplication].statusBarHidden = YES;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜