arnaucube
arnaucube/commonroutesServerPublic Self-hosted repository
commonroutesServer/www/plugins/cordova-plugin-splashscreen/doc/zh/README.md
www/plugins/cordova-plugin-splashscreen/doc/zh/README.mdRaw
  1<!--
  2# license: Licensed to the Apache Software Foundation (ASF) under one
  3#         or more contributor license agreements.  See the NOTICE file
  4#         distributed with this work for additional information
  5#         regarding copyright ownership.  The ASF licenses this file
  6#         to you under the Apache License, Version 2.0 (the
  7#         "License"); you may not use this file except in compliance
  8#         with the License.  You may obtain a copy of the License at
  9#
 10#           http://www.apache.org/licenses/LICENSE-2.0
 11#
 12#         Unless required by applicable law or agreed to in writing,
 13#         software distributed under the License is distributed on an
 14#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15#         KIND, either express or implied.  See the License for the
 16#         specific language governing permissions and limitations
 17#         under the License.
 18-->
 19
 20# cordova-plugin-splashscreen
 21
 22[![Build Status](https://travis-ci.org/apache/cordova-plugin-splashscreen.svg)](https://travis-ci.org/apache/cordova-plugin-splashscreen)
 23
 24這個外掛程式顯示和隱藏在應用程式啟動期間的初始螢幕。
 25
 26## 安裝
 27
 28    // npm hosted (new) id
 29    cordova plugin add cordova-plugin-splashscreen
 30    // you may also install directly from this repo
 31    cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git
 32    
 33
 34## 支援的平臺
 35
 36  * 亞馬遜火 OS
 37  * Android 系統
 38  * 黑莓 10
 39  * iOS
 40  * Windows Phone 7 和 8
 41  * Windows 8
 42  * Windows
 43  * 瀏覽器
 44
 45## 方法
 46
 47  * splashscreen.show
 48  * splashscreen.hide
 49
 50### Android 的怪癖
 51
 52在你的`config.xml`,您需要添加以下優惠:
 53
 54    <preference name="SplashScreen" value="foo" />
 55    <preference name="SplashScreenDelay" value="10000" />
 56    <preference name="SplashMaintainAspectRatio" value="true|false" />
 57    
 58
 59美孚在哪裡閃屏檔,最好是 9 修補程式檔的名稱。 請確保您的 splashcreen 檔添加到 res/xml 目錄下相應的資料夾。 第二個參數表示多久閃屏會顯示以毫秒為單位。 它將預設為 3000 毫秒。 有關更多資訊,請參見 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。
 60
 61"SplashMaintainAspectRatio"首選項是可選的。 如果設置為 true,可繪製的初始螢幕不會拉伸以適合螢幕,但相反只是"覆蓋"螢幕,像 CSS"背景-大小: 蓋"。 這是非常有用的不能以任何方式,例如當他們包含文本或風景畸變閃屏圖像時。 此設置適用于有大利潤 (安全區),可以安全地裁剪不同長寬比與螢幕上的圖像。
 62
 63該外掛程式重新載入初始可繪製只要方向發生變化,所以您可以指定不同的畫板為縱向和橫向方向。
 64
 65### 瀏覽器的怪癖
 66
 67你可以用你的`config.xml`下列優先選項:
 68
 69    <platform name="browser">
 70        <preference name="SplashScreen" value="images/browser/splashscreen.jpg" /> <!-- defaults to "img/logo.png" -->
 71        <preference name="SplashScreenDelay" value="10000" /> <!-- defaults to "3000" -->
 72        <preference name="SplashScreenBackgroundColor" value="green" /> <!-- defaults to "#464646" -->
 73        <preference name="ShowSplashScreen" value="false" /> <!-- defaults to "true" -->
 74        <preference name="SplashScreenWidth" value="600" /> <!-- defaults to "170" -->
 75        <preference name="SplashScreenHeight" value="300" /> <!-- defaults to "200" -->
 76    </platform>
 77    
 78
 79### iOS 的怪癖
 80
 81  * `FadeSplashScreen`(預設為`true`的布林值): 設置為`false` ,以防止出現閃屏衰落和退出其顯示狀態發生變化時。
 82    
 83        <preference name="FadeSplashScreen" value="false"/>
 84        
 85
 86  * `FadeSplashScreenDuration`(float,預設為`2`): 指定的閃屏秒數淡出效果來執行。
 87    
 88        <preference name="FadeSplashScreenDuration" value="4"/>
 89        
 90
 91  * `ShowSplashScreenSpinner`(boolean, `true`的布林值): 設置為`false`來隱藏初始螢幕微調框。
 92    
 93        <preference name="ShowSplashScreenSpinner" value="false"/>
 94        
 95
 96## splashscreen.hide
 97
 98解雇的閃屏。
 99
100    navigator.splashscreen.hide();
101    
102
103### 黑莓 10,WP8,iOS 怪癖
104
105`config.xml` 檔 `AutoHideSplashScreen` 設置必須是 `假` 的。 若要延遲兩秒鐘隱藏的閃屏,`deviceready` 事件處理常式中添加一個計時器,如下所示:
106
107        setTimeout(function() {
108            navigator.splashscreen.hide();
109        }, 2000);
110    
111
112## splashscreen.show
113
114顯示初始螢幕。
115
116    navigator.splashscreen.show();
117    
118
119您的應用程式無法調用 `navigator.splashscreen.show()`,直到該應用程式已啟動,且觸發了 `deviceready` 事件。 但是,由於通常的閃屏為了是可見的在您的應用程式啟動之前,這似乎會打敗閃屏的目的。 提供一些配置在 `config.xml` 中的會自動 `show` 初始螢幕您的應用程式啟動後立即和之前它已經完全起步並收到 `deviceready` 事件。 做這種配置的詳細資訊,請參閱 [圖示和啟動畫面](http://cordova.apache.org/docs/en/edge/config_ref_images.md.html)。 出於此原因,不太可能您需要調用 `navigator.splashscreen.show()`,使初始螢幕可見為應用程式啟動。