Search code examples
ipadxcode5uistatusbar

how to hide UIStatusbar on the ipad?


i was create the app for target for iphone in ios7. but when i tested that app into ipad then statusbar not hidden. in iphone its hide but not into ipad. please help me. i set the below code on my app. i set this to appdelegate. but its not hide the statusbar for ipad.

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];

i also set the View controller-based status bar appearance to NO and Status bar is initially hidden to YES into info.plist file.


Solution

  • Your code is correct, but since iOS 7 the iPad works slightly different with iPhone compatibility mode: the status bar is always visible, and there is no longer a 2x button to show the interface "zoomed in".

    Even though your code will work fine on iPhone, the iPad will always display the status bar on iPhone apps.