我的麻煩是我不能使一個透明的狀態欄,只有超級地圖。 這裏是超級製作:如何透明狀態欄無需更改NaviBar android
我嘗試使用
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);
}
但它使透明的所有狀態和navibar。我不想這樣。只是狀態欄。你能幫我嗎,夥計?只要按下任何評論事建議我
我的代碼:
<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>
只需添加這行做你想做的所有狀態欄在您的應用中保持透明? –
是的。所有狀態欄,但不影響Navibar。 –
查看我的回答下面 –