I have a stupid problem but I’m not able to solve it. I have a listView with custom layout of items (nothing complicated – three TextViews) and I need to change reduce the height of items in list. I tried to set android:layout_height=”70px” in item_layout.xml but it seems that this value do not have any affect on final height.
Do you have any idea what I did wrong?
Thanks a lot!
In 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"/>
In myActivity.java
> ListView lv1=(ListView)findViewById(R.id.my%list);
> lv1.setAdapter(new PaymentAdapter(this,R.layout.list_layout , my_array_list));
In list_layout.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="70px">
...
</RelativeLayout>
It will depend on your Item. You should make the item expandable whenever required. You could also probably handle this in the getView method of your adapter.