當我的應用程序在前臺運行被關閉,如果用戶點擊主頁按鈕我想告訴喜歡如何顯示警報時,應用程序在IOS
一些警告不要ü想退出該應用程序是/沒有按鈕。是否有任何代表方法被稱爲當主頁按鈕被點擊時...
謝謝...。
當我的應用程序在前臺運行被關閉,如果用戶點擊主頁按鈕我想告訴喜歡如何顯示警報時,應用程序在IOS
一些警告不要ü想退出該應用程序是/沒有按鈕。是否有任何代表方法被稱爲當主頁按鈕被點擊時...
謝謝...。
在iOS上沒有辦法做到這一點。我想你想要一個類似於Android後退按鈕的行爲。
將iOS主頁按鈕想象成Android主頁按鈕,它不會讓您提示用戶。
是的,我想要類似的行爲,如android,我也搜索了它沒有發現任何信息,感謝您的確認.. –
可以在使用這些方法AppDelegate.m
- (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.
}
不,你不能這樣做,在iOS中。有一個代表通知,但您的應用程序將立即轉到後臺。 – KudoCC
無論如何,你絕對不應該這樣做。如果用戶點擊主頁按鈕,他們想要離開您的應用程序。您的業務無一爲何,而且您無權干涉用戶的行爲。除非你想要1星評價(假設0星是不可能的)。 – gnasher729
請花一點時間接受答案(點擊複選標記)。你也可以投票的答案,因爲有幾個人試圖幫助你:) – 2015-08-29 06:39:53