iPhone如何创建全屏应用? [英] iPhone how to create a full screen app?
问题描述
我一直在尝试创建全屏视图。我计划使用核心图形进行渲染。我是iPhone开发的新手,所以请原谅这个基本问题。
I've been trying to create a full screen view. I plan on using core graphics for rendering. I am new to iPhone development so please forgive this basic question.
这是我的设置代码;
- (void)loadView
{
CGRect rect = [[UIScreen mainScreen] bounds];
GameView *main_view;
main_view = [[GameView alloc] initWithFrame:rect ];
main_view.clearsContextBeforeDrawing = NO;
self.view = main_view;
[main_view release];
}
然而,当我运行这个时,我会在顶部找到一个薄的状态栏时间和电池电量。
Yet when I run this I get a thin status bar at the top with the time and battery level.
我尝试寻找一些样品,但所有样品都是opengles。
I tried looking for some samples yet all the samples were opengles.
有人可以告诉我哪里出错了吗?以及如何创建全屏视图。
Could someone please tell me where I'm going wrong? And just how to create a full screen view.
谢谢
推荐答案
有两种方法;
在应用程序的info.plist中添加布尔
键 UIStatusBarHidden
并将其设置为true。
In the info.plist for your application add a boolean
key UIStatusBarHidden
and set it to true.
在运行时,您可以调用 setStatusBarHidden
在您的应用程序上显示/隐藏状态栏。例如
At runtime you can call setStatusBarHidden
on your application to show/hide the status bar. E.g.
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]
这篇关于iPhone如何创建全屏应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!