我尝试放大 ListView
以使其填满屏幕,但没办法。
这是布局代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
app:layout_collapseParallaxMultiplier="0.0">
<android.support.v7.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<TextView
android:id="@+id/textViewweight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:textAlignment="textEnd"
android:textAppearance="@android:style/TextAppearance.Material.Small"
app:layout_constraintHorizontal_bias="0.473"
app:layout_constraintLeft_toRightOf="@+id/textViewdrug"
app:layout_constraintRight_toLeftOf="@+id/textViewage"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/textViewage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Small"
app:layout_constraintHorizontal_bias="0.919"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/textViewdrug"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:textAlignment="textStart"
android:textAppearance="@android:style/TextAppearance.Material.Small"
app:layout_constraintHorizontal_bias="0.095"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</LinearLayout>
<ExpandableListView
android:id="@+id/idListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/graymillidos"
/>
</LinearLayout>
我的代码有错误吗?
以下是结果: