开发者

iPhone + UIView

I am having a strange problem:

In -(void)viewWillAppear:(BOOL)animated method I use:

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

It means I am hiding the StatusBar, since I am hiding it, all the controls in my View are shifted upside by some distance when I run the application so, it appears in different way than what I have designed in Interface Build开发者_如何学Goer.

Please help me so that my StatusBar remains hidden and View (and its controls) are not shifted from their position


Don't hide the StatusBar in your viewWillAppear unless the StatusBar is meant to be hidden for some views and not others. Otherwise hide the status bar either in appFinishedLoading or using the info.plist, as mentioned below.

As for items shifting up, there is a lot you can do to prevent that. In Interface Builder you could check the property not to resize views. You can also create your views to be as big as the screen without the status bar. You can also tell your buttons, labels, etc. not to move by going into the Interface Builder layout window and clicking on the red arrows and lines that attach an object to edges of the screen.


You could go into Interface Builder and add padding to anticipate the shift.


In your application's plist, add a new boolean with the key: UIStatusBarHidden and enable it. In interface builder, turn off the status bar. Now resize your views the way you want them in interface builder.


set the view to 480 pixels high in IB rather than 460.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜