本文整理匯總了TypeScript中@ionic-native/splash-screen/ngx.SplashScreen類的典型用法代碼示例。如果您正苦於以下問題:TypeScript SplashScreen類的具體用法?TypeScript SplashScreen怎麽用?TypeScript SplashScreen使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SplashScreen類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.platform.ready().then(async () => {
let defaultLanguage;
if (this.platform.is('ios') || this.platform.is('android')) {
defaultLanguage = (await this.globalization.getPreferredLanguage()).value.slice(0, 2);
this.statusBar.styleLightContent();
this.splashScreen.hide();
} else {
defaultLanguage = navigator.language.slice(0, 2);
}
// we assume that availableLanguage[0] is default language if user language is not available
if (environment.availableLanguage && environment.availableLanguage.length > 0) {
if (environment.availableLanguage.indexOf(defaultLanguage) === -1) {
defaultLanguage = environment.availableLanguage[0];
}
} else {
// or 'fr' if array is empty
defaultLanguage = 'fr';
}
this.translate.setDefaultLang(defaultLanguage);
this.settings.loadSettings();
this.onlineTreks.loadTreks();
});
示例2:
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
});
示例3:
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
});