通过插件cordova-plugin-splashscreen显示启动画面.但是,当应用程序启动并显示初始屏幕时,状态栏不会被隐藏.显示启动画面时如何隐藏状态栏?我找到了这个解决方案:
How to completely hide the status bar in iOS using Cordova?
但是它可以在iOS上运行.我的平台是AndroID.
解决方法:
在ionic 3应用中,如果< preference name =“ Fullscreen” value =“ true” />不起作用,请执行以下 *** 作:
>安装全屏插件:
ionic cordova plugin add cordova-plugin-fullscreennpm install --save @ionic-native/androID-full-screen
>将其添加到config.xml文件中以自定义主题:
<Widget ... xmlns:androID="http://schemas.androID.com/apk/res/androID"> // note this xmlns:androID line <platform name="androID"> ... <edit-config file="AndroIDManifest.xml" mode="merge" target="/manifest/application/activity"> <activity androID:theme="@androID:style/theme.NoTitlebar.Fullscreen"/> </edit-config> </platform></Widget>
>在src / app / app.module.ts中添加全屏提供程序:
....// add this line at the top of the file, import itimport {AndroIDFullScreen} from "@ionic-native/androID-full-screen";...provIDers: [ Statusbar, SplashScreen, {provIDe: ErrorHandler, useClass: IonicErrorHandler}, AndroIDFullScreen, // here add this line ...]
>在src / app / app.components.ts中使用它:
// add this line at the top of the file, import itimport {AndroIDFullScreen} from "@ionic-native/androID-full-screen";...constructor(public platform: Platform, public statusbar: Statusbar, public splashScreen: SplashScreen, public androIDFullScreen: AndroIDFullScreen) { // show statusbar this.androIDFullScreen.isSupported() .then(() => this.androIDFullScreen.showsystemUI()); // style statusbar and hIDe splash this.platform.ready().then(() => { this.statusbar.styleDefault(); this.splashScreen.hIDe(); });}...
总结 以上是内存溢出为你收集整理的android-科尔多瓦在显示启动画面时隐藏状态栏全部内容,希望文章能够帮你解决android-科尔多瓦在显示启动画面时隐藏状态栏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)