下面是 ListView
行的图像,它太短了。我尝试了太多的组合,让我对 StackOverflow 感到沮丧。
如何解决这个问题并显示整行?这是项目的 XML。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:weightSum="1">
<LinearLayout android:id="@+id/item_left"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingRight="2dp"
android:paddingLeft="2dp"
android:background="@drawable/item_left"
android:layout_gravity="fill_vertical">
<TextView
android:id="@+id/status_day"
android:layout_gravity="center_vertical"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:textColor="@color/item_left_text"
android:textSize="25sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="2dp"
android:background="@drawable/item_right"
android:layout_weight="1">
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_right_text"
android:text="" />
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_right_text"
android:text="" />
</LinearLayout>
<ImageButton
android:id="@+id/options"
android:background="@drawable/item_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_moreoverflow_normal_holo_light"
/>
</LinearLayout>
感谢任何帮助。
最佳答案
你能用这个吗,设置行布局高度
android:layout_height="?android:attr/listPreferredItemHeight"
关于android - ListView 行高太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11681777/