私はAndroidが初めてで、レイアウトに関して多くの問題に直面しています。私は上部にToolbar
の画面を持っています。その下には、私はImageView
、そしてImageView
の下には、ListView
があります。私はListView
の高さをレイアウトする問題に直面しています。私のListView
は画面上の最後の項目なので、画面の残りの部分に合わせたいと思います。これは、適合するようにListView
のサイズを動的に変更したいのですか?以下は、私は、画面に設定されたレイアウトは次のとおりです。Androidの下部にリストビューを合わせるには
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.team.sidhesh.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="617dp"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorAccent"
app:popupTheme="@style/AppTheme.PopupOverlay" />
<ImageView
android:id="@+id/sliderTempImageView"
android:layout_width="match_parent"
android:layout_height="@dimen/slider_image_height"
android:src="@drawable/slider_image1"
android:scaleType="centerCrop"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/slider_seperator_height"
android:src="@drawable/slider_seperator"
android:scaleType="fitXY"/>
<ListView
android:id="@+id/list_view"
android:background="@android:color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true">
</ListView>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>