how to hide the title bar(top bar) in iphone from a view [duplicate]

风格不统一 提交于 2019-12-01 23:47:32

The easiest way to hide the status bar is to go into youInfo.plist; right click to add a row and select Status Bar Initially hidden.

This will ensure every time you app launches the status bar will be hidden.

Edit

with programming

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
self.navigationController.navigationBar.frame = CGRectMake(0, 0, 320, 44);

and when you want to show the statusbar just use bellow code..

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
self.navigationController.navigationBar.frame = CGRectMake(0, 45, 320, 44);

i hope this help you...

:)

In AppDelegate class applicationDidFinishLaunching ,write the below code

- (void) applicationDidFinishLaunching:(UIApplication *)application
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
}

All other views (except first View) when you need to display StatusBar, write the below code in curresponding ViewDidiLoad() / viewWillAppear,

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

in your info.pist find this option. "Status bar is initially hidden" And set as YES.

Depends which version of Xcode you are using.

In 4.5 you can go into the build settings "Summary" tab and set this in the "Status Bar" section.

If you don't have 4.5 then in the build settings "Info" section add a plist entry for "Status Bar Is Initially Hidden" and set it to YES. (Alternatively, download Xcode 4.5 because you should do this anyway).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!