我的右侧弹出菜单留下了一些我不想要的空间。有没有办法做到这一点。我尝试了很多主题,但没有得到任何解决方案。如果有人能给我一些解决方案,那将会有所帮助
我的xml是
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
android:padding="4dp"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<ImageButton
android:id="@+id/imageView4"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#f04d3c"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:src="@drawable/search_icon" />
<ImageButton
android:id="@+id/imageView5"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="2dp"
android:background="#f04d3c"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:src="@drawable/cart_icon" />
<ImageButton
android:id="@+id/imageView3"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#f04d3c"
android:layout_gravity="right"
android:layout_marginRight="2dp"
android:layout_alignParentRight="true"
android:src="@drawable/notification_icon" />
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar">
<ExpandableListView
android:id="@+id/navList"
android:layout_width="270dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:dividerHeight="1dp"
android:divider="@drawable/list_divider"
android:childDivider="@drawable/child_list_divider"
/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
我的风格是使用Theme.AppCompat.Light.NoActionBar
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#f04d3c</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">#f04d3c</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="colorAccent">#FF4081</item>
</style>
</resources>