【发布时间】:2012-01-05 19:40:58
【问题描述】:
我有一个愚蠢的问题,但我无法解决它。我有一个带有自定义项目布局的 listView(没什么复杂的 - 三个 TextView),我需要更改以减少列表中项目的高度。我尝试在 item_layout.xml 中设置 android:layout_height="70px" 但似乎这个值对最终高度没有任何影响。
你知道我做错了什么吗?
非常感谢!
在 main.xml 中
<ListView
android:id="@+id/wf8_card_list"
android:layout_width="match_parent"
android:layout_height="160px"
android:layout_marginLeft="-10px"
android:layout_marginRight="-10px"
android:layout_weight="0.5"
android:headerDividersEnabled="false"
android:footerDividersEnabled="false"
android:cacheColorHint = "#00000000"
android:listSelector="@drawable/transaction_list_bacground"/>
在 myActivity.java 中
> ListView lv1=(ListView)findViewById(R.id.my%list);
> lv1.setAdapter(new PaymentAdapter(this,R.layout.list_layout , my_array_list));
在 list_layout.xml 中
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="70px">
...
</RelativeLayout>
【问题讨论】:
标签: android listview height max