久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      • <bdo id='yrDSr'></bdo><ul id='yrDSr'></ul>
    1. <i id='yrDSr'><tr id='yrDSr'><dt id='yrDSr'><q id='yrDSr'><span id='yrDSr'><b id='yrDSr'><form id='yrDSr'><ins id='yrDSr'></ins><ul id='yrDSr'></ul><sub id='yrDSr'></sub></form><legend id='yrDSr'></legend><bdo id='yrDSr'><pre id='yrDSr'><center id='yrDSr'></center></pre></bdo></b><th id='yrDSr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yrDSr'><tfoot id='yrDSr'></tfoot><dl id='yrDSr'><fieldset id='yrDSr'></fieldset></dl></div>

    2. <small id='yrDSr'></small><noframes id='yrDSr'>

    3. <tfoot id='yrDSr'></tfoot>
      <legend id='yrDSr'><style id='yrDSr'><dir id='yrDSr'><q id='yrDSr'></q></dir></style></legend>
    4. 如何區分iOS5上的屏幕鎖定和主頁按鈕按下?

      How to differentiate between screen lock and home button press on iOS5?(如何區分iOS5上的屏幕鎖定和主頁按鈕按下?)

        <tbody id='4Lowc'></tbody>
        <i id='4Lowc'><tr id='4Lowc'><dt id='4Lowc'><q id='4Lowc'><span id='4Lowc'><b id='4Lowc'><form id='4Lowc'><ins id='4Lowc'></ins><ul id='4Lowc'></ul><sub id='4Lowc'></sub></form><legend id='4Lowc'></legend><bdo id='4Lowc'><pre id='4Lowc'><center id='4Lowc'></center></pre></bdo></b><th id='4Lowc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4Lowc'><tfoot id='4Lowc'></tfoot><dl id='4Lowc'><fieldset id='4Lowc'></fieldset></dl></div>
        <legend id='4Lowc'><style id='4Lowc'><dir id='4Lowc'><q id='4Lowc'></q></dir></style></legend>

        • <bdo id='4Lowc'></bdo><ul id='4Lowc'></ul>
        • <small id='4Lowc'></small><noframes id='4Lowc'>

                <tfoot id='4Lowc'></tfoot>
              • 本文介紹了如何區分iOS5上的屏幕鎖定和主頁按鈕按下?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在開發一個在后臺播放音頻的 iPhone 應用.如果用戶鎖定屏幕,我希望音頻繼續播放,但如果他們決定切換到另一個應用程序(通過按下主頁按鈕),則暫停.

                I'm developing an iPhone app that plays audio in the background. I want the audio to keep playing if the user locks the screen, but pause if they decide to switch to another app (by pressing the home button).

                在 iOS 4 上沒有問題,因為應用程序會在屏幕鎖定時進入非活動狀態,并且只有在按下主頁按鈕時才會移動到后臺.在 iOS 5 上,當屏幕鎖定時,應用程序現在也被移到后臺,因此似乎不再可能區分這兩種狀態.這個問題有解決辦法嗎?

                On iOS 4 there was no problem because the app would go into the inactive state when the screen was locked and only be moved to the background if the home button was pressed. On iOS 5 when the screen is locked the app is now also moved into the background, so it seems it is no longer possible to tell the difference between the two states. Is there a solution to this problem?

                推薦答案

                您可以通過檢查 UIApplicationapplicationState 屬性來區分這兩種情況.對于因鎖屏而進入后臺的應用程序,它將設置為 UIApplicationStateInactive,否則設置為 UIApplicationStateBackground.

                You can distinguish these two cases by checking the applicationState property of UIApplication. It will be set to UIApplicationStateInactive for an application that did enter background because of the lock screen, and to UIApplicationStateBackground otherwise.

                - (void)applicationDidEnterBackground:(UIApplication *)application
                {
                    UIApplicationState state = [application applicationState];
                    if (state == UIApplicationStateInactive) {
                        NSLog(@"Sent to background by locking screen");
                    } else if (state == UIApplicationStateBackground) {
                        NSLog(@"Sent to background by home button/switching to other app");
                    } 
                }
                

                這篇關于如何區分iOS5上的屏幕鎖定和主頁按鈕按下?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報)
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))

                1. <i id='1AhbI'><tr id='1AhbI'><dt id='1AhbI'><q id='1AhbI'><span id='1AhbI'><b id='1AhbI'><form id='1AhbI'><ins id='1AhbI'></ins><ul id='1AhbI'></ul><sub id='1AhbI'></sub></form><legend id='1AhbI'></legend><bdo id='1AhbI'><pre id='1AhbI'><center id='1AhbI'></center></pre></bdo></b><th id='1AhbI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1AhbI'><tfoot id='1AhbI'></tfoot><dl id='1AhbI'><fieldset id='1AhbI'></fieldset></dl></div>

                  <small id='1AhbI'></small><noframes id='1AhbI'>

                        <bdo id='1AhbI'></bdo><ul id='1AhbI'></ul>
                      • <tfoot id='1AhbI'></tfoot>

                      • <legend id='1AhbI'><style id='1AhbI'><dir id='1AhbI'><q id='1AhbI'></q></dir></style></legend>

                          <tbody id='1AhbI'></tbody>
                          主站蜘蛛池模板: 亚洲成人精 | 九九久久精品 | 日本三级网站在线 | 一区视频 | av在线一区二区三区 | 91新视频 | 亚洲精品久久久蜜桃 | 国产精品一区二区福利视频 | 欧美6一10sex性hd | 亚洲精品一区二区三区在线 | 亚洲视频一区二区三区 | 99久久成人 | av成人在线观看 | 国产欧美性成人精品午夜 | 精品视频99 | 毛片入口 | 成人久久18免费 | 亚洲精品日韩一区二区电影 | 亚洲精品免费观看 | 午夜影晥 | 午夜免费精品视频 | 亚洲国产aⅴ精品 | 欧美视频一区二区三区 | 三级成人片 | 国产区高清 | 久久91精品 | 亚洲国产黄 | 婷婷在线视频 | 国产羞羞视频在线观看 | 日韩精品一区二区三区中文在线 | 中文字幕一区二区三区精彩视频 | 亚洲精品一区二三区不卡 | 精品婷婷 | 第一区在线观看免费国语入口 | 麻豆精品国产免费 | 韩三级在线观看 | 成人国产精品久久 | 久久成人国产 | 精品免费 | 中文字幕一区二区视频 | 99精品国产一区二区三区 |