【发布时间】:2015-12-18 11:52:00
【问题描述】:
我是android初学者,我想创建status bar和Toolbar一样,当DrawerLayout打开时statusBar又改成DrawerLayout一样,如何解决这个问题。我已经设置了样式parent="Theme.AppCompat.Light.NoActionBar
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="#ed9797"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/DrawerLayout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="#e62e2e"
android:minHeight="?attr/actionBarSize"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp">
</android.support.v7.widget.Toolbar>
</RelativeLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:background="#46dfcd"
android:id="@+id/leftDrawer"
android:layout_width="250dp"
android:layout_height="match_parent"
android:text="Drawer page"
android:layout_gravity="start"/>
【问题讨论】: