2
A
回答
2
是的,有點。
單擊主頁按鈕或關閉屏幕將導致您的應用程序被置於後臺(applicationDidEnterBackground
),而電話不會,並且只會讓您的應用程序退出其活動狀態(applicationWillResignActive
)。
但是,其他操作(例如提高多任務欄)也會導致您的應用程序退出。
+0
+1給你,你比我快20秒;-) –
+0
幸運我;)謝謝! – borrrden
0
您無法處理主頁按鈕單擊。但當用戶點擊主頁按鈕或點擊應用程序圖標代表方法應用程序被調用。你可以編寫代碼。
- (void)applicationWillResignActive:(UIApplication *)application
{
/* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
*/
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}
- (void)applicationWillTerminate:(UIApplication *)application
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackground:.
*/
}
它可以幫助你解決旅遊問題。
相關問題
- 1. PhoneGap點擊後退按鈕模擬點擊主頁按鈕
- 2. 區分按鈕點擊和javascript頁面重新加載
- 3. iOS按鈕點擊區域不一致
- 4. ios雙擊主頁按鈕事件
- 5. MonkeyTalk點擊ActionBar主頁按鈕
- 6. 主頁按鈕不可點擊
- 7. jQuery按鈕點擊隱藏分區
- 8. 設置分頁按鈕點擊
- 9. 功能區按鈕點擊
- 10. 區分點擊和滾動 - iOS
- 11. 當主頁按鈕點擊時,部分捲曲得到消失
- 12. MD-按鈕點擊的iOS
- 13. 在主頁按鈕上點擊開始進度條點擊
- 14. 區分點擊並按住並點擊
- 15. 電暈如何區分點擊和長按?
- 16. 頁面id點擊按鈕點擊
- 17. AS3 stage.Activate和stage.deactivate適合用戶點擊iPad主頁按鈕?
- 18. 如何在iOS5上區分屏幕鎖定和主頁按鈕?
- 19. 點擊按鈕聽起來
- 20. 在Android活動中區分主頁按鈕和後退按鈕的功能?
- 21. 點擊一個按鈕來模擬點擊多個按鈕
- 22. 按鈕開始轉移點擊分頁按鈕-angular bootstrap用戶界面分頁
- 23. 發佈和按鈕點擊分享
- 24. 如何在點擊按鈕時複製主頁按鈕雙擊效果?
- 25. 按下主頁按鈕時檢測iOS
- 26. Node-Red + Arduino節點 - 區分長按按鈕和短按鈕
- 27. 在iOS 4.3中,當按下主頁按鈕或按下開/關按鈕時,如何區分背景模式?
- 28. JavaFX:區分點擊和點擊拖動
- 29. 按鈕點擊和LinkButton點擊
- 30. 按鈕點擊和ListView點擊
wt你想要????和wt是你的問題? – iPatel
我的問題是運行應用程序時,如果我收到一個電話並收到它,那麼應用程序將進入後臺模式。如果通話沒有收到,它的工作正常。 所以我的問題是我不得不區分當應用程序進入背景模式在以下兩種情況: 1.When手動退出應用程序的主頁按鈕單擊。 2.接到電話。 – silentBeep