1.据了解,listview每行的高度是由 inflater填充布局中高度最大的那个控件来决定的。
<?xml version="1.0" encoding="utf-8"?>
<!-- android:layout_centerVertical="true" -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_question"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white_color" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical" >
<!-- android:layout_centerVertical="true" -->
<TextView
android:id="@+id/tv_instruct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="50dp"
android:layout_marginTop="14dp"
android:singleLine="true"
android:textColor="@color/version_name_3c3f46"
android:textSize="15sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="15dp"
android:background="@drawable/list_right_arrow"
android:contentDescription="@null" />
</RelativeLayout>
》 2.可以说试试在item的layout文件中,给item设定minHeight,即可。请如下黑色粗体所示:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:minHeight="100dp" > <TextView android:id="@+id/textView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/hello" /> </LinearLayout>