0

In my listview one row was in bigger in size.

  1. Initially all are in same width and height

  2. After scrolling some time one row become bigger (see in below image) now in Entertainment

  3. Scrolling again that Gaming will become bigger

How to resolve?

enter image description here

4

1 回答 1

0

It looks like your items are varying in height a little bit.

One of the standard things to do for a ListView is to use the Android Attribute listPreferredItemHeight which will provide a preferred item height for the device.

So. Your layout for the list items would look something like this:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:gravity="center_vertical"
/>

This will give you a single TextView for each item, with the preferred system height.

于 2013-10-23T13:32:16.410 回答