ActionBarの高さに設定されているXMLの余白のために、この灰色のバーを取り除くことはできません。最終的にアクションバーが表示されますが透明ですが、最初からこのグレーの背景を取り除くにはどうすればよいですか? paddingTopを使用すると、アクションバーはクリックできません。灰色の背景余白のためにAndroidのメインコンテンツ
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:orientation="vertical">
<include
android:id="@+id/action_bar"
layout="@layout/action_bar" />
</RelativeLayout>
<FrameLayout
android:layout_marginTop="?attr/actionBarSize"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView android:id="@+id/left_drawer"
android:background="#FFFFFF"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:choiceMode="singleChoice"/>
</android.support.v4.widget.DrawerLayout>
LinearLayout –
これはうまくいきましたが、アクションバーのコンテナに 'android:layout_height =" wrap_content "'を作成し、引き出しのListViewを移動しなければなりませんでした。 –
申し訳ありませんが、あなたのコードをコピーして貼り付け、親レイアウトを追加しただけです –