隐藏状态栏,但现在已替换为白色栏(iPhone 界面 XIB)
我使用此代码隐藏状态栏
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
在视图 xib 上,我已将状态栏设置为“无”,因此没有状态栏。
当我运行应用程序时,状态栏与运营商、电池信息等一起消失。但现在是一个白色的栏,所以本质上状态栏在那里,但是是白色的。
我也尝试过通过 p 列表更改它。但通过我这样做,我的所有对象都会“向上”移动,并且尺寸会变得混乱。
谢谢
I've used this code to hide the status bar
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
On the view xib I have set the status bar to 'none' so there is no status bar.
When i run the app, the status bar has disappeared with the carrier, battery info etc. But is now a white bar, so in essence the status bar is there, but is white.
I have also tried changing it via the p list. But by me doing this, all my objects move 'up' and the sizing messes up.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请务必在设置
self.window
框架之前将 statusBar 设置为隐藏,如下所示:这样做,窗口似乎会自行定位,而不会为 StatusBar 留出空间,从而填充整个屏幕
Be sure to set the statusBar hidden before you set the
self.window
frame, something like this:Doing so the window seems to position itself without leaving space for the StatusBar, thus filling the whole screen
如果没有状态栏,您将有一个 20x320 点的矩形可供使用。您的视图大小需要适应这一点,然后您需要用一些东西填充该空间。当然,您的视图会“向上”移动,并且您的尺寸会变得混乱。那么你要在那里放什么?
Without the status bar you have a 20x320 points rectangle to work with. Your view sizing needs to adjust to this, and then you need to fill that space with something. Of course your views will move 'up' and your sizing get messed up. So what are you gonna put there?