I am hiding the Status bar with the below code and it gives me a memory warning level1 . It does nothing to the app itself during the memory warning but I do not like to have such things happening. Is there somthing I am doing wrong? or and con someone confirm a IOS bug? Not a huge deal just bothering me , so any info is greatly appreciated. Thanks!
[[UIApplication sharedApplication] setStatusBarHidden:YES
withAnimation:U开发者_开发知识库IStatusBarAnimationSlide];
Try this
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) {
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
}
else {
id<UIApplicationDeprecatedMethods> app = [UIApplication sharedApplication];
[app setStatusBarHidden:YES animated:NO];
}
}
and declare in your .h
@protocol UIApplicationDeprecatedMethods
- (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated;
@end
Hope it helps..
精彩评论