【发布时间】:2017-08-26 04:24:29
【问题描述】:
我的麻烦是我不能像超级地图那样制作透明的状态栏。 这是超级制造的:
我尝试过使用
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow(); // in Activity's onCreate() for instance
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
但它使所有状态和导航栏变得透明。我不想这样。只是状态栏。你能帮帮我吗,伙计?只要点击评论任何建议我的东西
我的代码:
<android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
style="@style/AppThemeMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
layout="@layout/app_bar_maps"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:visibility="visible"
app:headerLayout="@layout/nav_header_maps"
app:itemTextAppearance="@style/NavigationDrawerStyle"
app:menu="@menu/activity_maps_drawer"
app:theme="@style/NavigationDrawerStyle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical">
<goixeom.com.CustomTextView
android:id="@+id/term"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/size_margin_nav"
android:layout_marginLeft="72dp"
android:text="Quyền riêng tư"
android:textStyle="bold" />
<goixeom.com.CustomTextView
android:id="@+id/dang_xuat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/size_margin_nav"
android:layout_marginLeft="72dp"
android:text="Điều khoản"
android:textStyle="bold" />
</LinearLayout>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
你想让你的应用中的所有状态栏都是透明的吗?
-
是的。所有状态栏,但不影响导航栏。
-
在下面查看我的答案
-
你是怎么解决这个问题的?
标签: android dictionary statusbar transparent