这看起来像一个重复的问题,但我无法做到。我想要完整的透明(不是半透明)状态栏以及导航栏,并希望内容出现在它们后面。显示状态和导航栏背后的内容
activity_details.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
tools:context="com.bitspilanidvm.bosm2017.DetailsActivity">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/q"
android:scaleType="centerCrop"/>
</LinearLayout>
V21 styles.xml
<resources>
<!-- Theme for API level > 21 -->
<style name="AppTheme" parent="AppBaseTheme">
<!--Customize your theme here. -->
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
在活动的java文件
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
这是我得到的。
如何获得导航栏后面的内容?
如果我添加
<item name="android:windowTranslucentNavigation">true</item>
我styles.xml
这里是我所得到的
正如你所看到的,内容云的背后导航栏,但导航栏必须是半透明的。
有没有解决方案?
不错这个设备有没有硬背按钮? –