繁体   English   中英

在启动屏幕活动期间进入全屏

[英]Enter full-screen during splash-screen activity

我目前正在尝试在启动屏幕“ Activity期间进入全屏模式。 我这样做是通过style设置的,它是在Activity上设置的,如下所示:

style.xml

<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@drawable/background_splash</item>
</style>

AndroidManifest.xml

<activity
    android:name=".Activities.SplashScreenActivity"
    android:noHistory="true"
    android:screenOrientation="portrait"
    android:theme="@style/SplashTheme">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

您可能会建议以编程方式执行此操作,但是我已经尝试过thisthisthisthisthisthis链接的所有答案。 目前,没有一种编程解决方案对我splashActivity.java —将每个建议的修复都放在我的splashActivity.java onResumeonCreate中,但是状态和导航栏仍然可见。 但是,使用我的自定义style它仅隐藏状态栏,导航栏保持可见。 到目前为止,我在xml文件中尝试过的工作:使用样式的不同父项,不使用背景可绘制,从activity删除screenOrientationnoHistory 我很确定我在这里遗漏了一些东西,但是我看不到。 如果需要,可以共享更多代码。 提前致谢!

这是我的SplashScreenActivity样式:

<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowBackground">@drawable/splash_logo_drawable</item>
</style>

我只使用属性windowBackground

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM