如何删除“基于视图的应用程序”中的状态栏- iOS
这是我试图习惯使用 XCode4 的一部分...
好吧,所以我在 XCode 4 中创建了一个新项目,并使用了基于视图的应用程序模板;我希望构建新的应用程序,因为苹果希望我使用这个模板。
所以我使用的是从 AppDelegate 调用的自动创建的视图控制器(到目前为止我还没有触及任何东西)。现在,我想删除状态栏。据我了解,我应该做的是转到查看 XIB 并在属性检查器中将状态栏字段设置为 < strong>无(到目前为止我都是这样做的),但是当我运行应用程序时,状态栏仍然在那里(!)。
我还尝试在 mainWindow.xib 文件上执行相同的操作(将 STSTUS BAR 属性设置为“无”),并且应用程序运行时会使用此栏来阻挡我的视线...
有人吗?
This is a part of me trying to get used to working with XCode4...
OK, so i've created a new project in XCode 4 and I used the View Based Application template; I wish to build the new app as Apple intended me to use this template.
So I'm using the automatically-created-view-controller which is called from the AppDelegate (so far I haven't touched anything). Now, I want to remove the STATUS BAR. As far as I understand, what I should do, is go to the view XIB and in the Attributes Inspector set the Status Bar field to None (this is how I used to do it so far), but mercilessly when I run the application the STATUS BAR is still there (!).
I also tried to do the same thing on the mainWindow.xib file (the setting the STSTUS BAR attribute to None thing) and the app runs with this bar that blocks my view...
Anyone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您阅读“标题”,您将看到“模拟指标”。这些属性仅用于在您使用 InterfaceBuilder 布局代码时模拟视觉元素。
如果您在应用程序委托中执行此操作,则可以这样写:
在此方法中:
编辑
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setStatusBarHidden:withAnimation:
在评论中请求,来自文档:
因此,如果您对动画部分不感兴趣,我建议使用此:
If you read the "header" you will see "Simulated metrics". Those properties are only to simulate visual elements when you lay out your code with interfacebuilder.
If you do it in the Application Delegate you write:
in this method:
EDIT
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setStatusBarHidden:withAnimation:
Requested in comment, from documentation:
So if you are not interested in the animation part I suggest using this: