2009-09-15 69 views
5

我正在为openGL中的iPhone制作一个小游戏。在我的应用程序中删除状态栏

首先我通过书面方式

[[UIApplication sharedApplication] setStatusBarHidden:YES]; 

哪些工作去掉了“状态栏”,只是去掉了状态栏时,我的应用程序开始运行。然后我修改了我的项目.plist

<key>UIStatusBarHidden</key> 
<true/> 

现在状态栏从不显示,只是我想要的。问题是我在屏幕的任何部分读取触摸没有问题,除了状态栏以前的区域。

// This method deals with events when one or more fingers touch the screen 
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 
    [myProject newTouch:touches withEvent:event]; 
    [self.nextResponder touchesEnded: touches withEvent:event]; 
} 

// This method deals with events when one or more fingers moves while touching the screen 
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { 
    [myProject movingTouch:touches withEvent:event ]; 
} 

// This method deals with events when one or more fingers stops touching the screen 
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 
    [myProject oldTouchEnded:touches withEvent:event ]; 
} 

// This method deals with events when the system is interrupted (for example an incomming call) 
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { 
    // 
} 

我想,躲在酒吧是不够的,它必须被删除,但我该怎么办呢?或者还有另一种解决方案?

+0

我遇到同样的问题。它发生在模拟器和设备 - iPhone 3GS,OS 3.1.3上。 – Axeva 2010-05-29 14:15:45

回答

1

您正在阅读的视图的大小是多少?有时候人们会隐藏状态栏,但忘记调整视图以覆盖适当的区域。完整的屏幕是320x480 - 确保你的身高是全长480px,而不是460或更小。

+0

是的,它的320 X 480,但问题仍然存在。 – 2009-09-15 14:42:58

1

模拟器中存在一个错误:它不会在状态栏(或将要)位置注册触摸。不过,它可以在设备上正常工作。

您是在模拟器上还是在设备上测试?

+0

问题在设备和模拟器中都会发生。 – 2009-09-15 14:38:21

相关问题