私は次のレイアウトを使用しています。基本的には、カスタムツールバー、ナビゲーションドロワー、メニュー、ListView(listView1)、およびadlayがあります。ListViewが下に降ります
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/header_bg"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_above="@+id/adlay"
android:layout_margin="7dp"
android:cacheColorHint="#00000000"
android:divider="@android:color/transparent"
android:dividerHeight="3dp">
</ListView>
<LinearLayout
android:id="@+id/adlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
</LinearLayout>
</RelativeLayout>
<ListView
android:id="@+id/drawer_list"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#eee"
android:dividerHeight="1dp"
android:background="#fff"
android:layout_below="@+id/toolbar"
>
</ListView>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
レイアウトは一種の次の順序のようなものです:ListView1のリストで構成されています(ナビゲーション引き出して、メニュー付き)
- ツールバー
- ListView1の
- ハトムギ
外部XMLファイルからロードされた項目の数。
問題はこれです。 listView1の項目がそれほど多くない場合は、下に落ちて、広告の上に座っていて、ツールバーとlistView1の間にlistView1の上にギャップがあります。 (ナビゲーション引き出して、メニュー付き)
- ツールバー
- GAP:ディスプレイには、以下のようなものです! < ---私はここにギャップがあることを望んでいない!
- ListView1の
- ハトムギ
これは表示を望みません。
理想的には、私は次のことをしたい:
- (ナビゲーション引き出して、メニュー付き)ツールバー
- ListView1の
- GAPはここ
- ハトムギ
すべてのヘルプははるかにあるべきです感謝。ありがとう。
問題のスクリーンショットを追加できますか? – motis10
お返事ありがとうございます。しかし、私は上記のように私のレイアウトのすべてを保持する問題を修正しましたが、match_parentへのlistView1のlayout_heightのみを変更しました。 – Dopinder