本文整理汇总了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();
});