2009-09-15 35 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

相關問題