[英]Enter full-screen during splash-screen activity
I am currently trying to go full-screen during my splash-screen Activity
. 我目前正在尝试在启动屏幕“
Activity
期间进入全屏模式。 I am doing that with a style
, which is set on the Activity
like this: 我这样做是通过
style
设置的,它是在Activity
上设置的,如下所示:
style.xml 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 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>
You might suggest doing that programmatically, but I already tried all the answers from this , this , this , this , this and this link. 您可能会建议以编程方式执行此操作,但是我已经尝试过this , this , this , this , this和this链接的所有答案。 Currently, none of the programmatic solutions work for me - put every suggested fix in either
onResume
or onCreate
of my splashActivity.java
, but the status and navigation bar were still visible. 目前,没有一种编程解决方案对我
splashActivity.java
—将每个建议的修复都放在我的splashActivity.java
onResume
或onCreate
中,但是状态和导航栏仍然可见。 However, when using my custom style
it hides only the status bar, the navigation bar stays visible. 但是,使用我的自定义
style
它仅隐藏状态栏,导航栏保持可见。 What I've tried so far in the xml files: used different parents of the style, used no background drawable, removed screenOrientation
and noHistory
from activity
. 到目前为止,我在xml文件中尝试过的工作:使用样式的不同父项,不使用背景可绘制,从
activity
删除screenOrientation
和noHistory
。 I am pretty sure I'm missing something here, but I can't see what. 我很确定我在这里遗漏了一些东西,但是我看不到。 Can share more code if needed.
如果需要,可以共享更多代码。 Thanks in advance!
提前致谢!
Here my SplashScreenActivity style: 这是我的SplashScreenActivity样式:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_logo_drawable</item>
</style>
I only use the attribute windowBackground
我只使用属性
windowBackground
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.