【发布时间】:2018-08-14 06:23:54
【问题描述】:
我正在使用主题从可绘制对象中制作启动画面。但是,启动画面的可绘制对象显示在系统栏后面,如下所示。
这是我的可绘制初始屏幕splash_screen.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/slighty_red" />
<item>
<bitmap
android:src="@drawable/test_icon"
android:gravity="center_horizontal|bottom" />
</item>
</layer-list>
这是我的初始屏幕主题:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:fitsSystemWindows">true</item> <!--Tried this but it doesn't work-->
</style>
然后我将此主题应用于清单中的启动活动:
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
我已经尝试在启动主题中将fitsSystemWindows 设置为true,而我的启动活动没有布局文件可以将fitsSystemWindows 设置为true。
我怎样才能让我的启动画面不显示在系统栏后面?
【问题讨论】:
-
与其让它那样显示,为什么要让它全屏显示呢?
标签: android android-studio splash-screen