다음 레이아웃을 사용하고 있습니다. 기본적으로 사용자 정의 도구 모음, 탐색 창, 메뉴, ListView (listView1) 및 채우기가 있습니다.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의 항목이 그리 많지 않은 경우, 아래쪽으로 내려가 adlay 위에 위치하며 도구 모음과 listView1 사이에 listView1 위에 간격이 있습니다. 디스플레이는 다음과 같다 :
- 도구 모음! < --- 나는 그 격차가 여기 있기를 원하지 않는다!
- listView1
- 율무이 표시를 원하지 않는
.
어떤 도움이 많이
- 도구 모음 :
이상적으로, 나는 다음 원하는 고맙습니다. 감사.
문제의 스크린 샷을 추가 할 수 있습니까? – motis10
답변 해 주셔서 감사합니다. 하지만 위와 같이 레이아웃에서 모든 것을 유지하면서 문제를 해결했지만 listView1의 layout_height 만 match_parent로 변경했습니다. – Dopinder