如上述截图所示,我的listview底部的预览和开头重复了,但是里面点开的详情页,都是正常的。
开始我以为图片太大了,把图片各种裁切减小依然没有效果。
后来经过我反复探索发现,需要把listview的宽度改一下。我从100dip改成了80dip就可以了:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dip">
<ImageView
android:id="@+id/thumb"
android:layout_width="60dip"
android:layout_height="60dip"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true" />
<TextView
android:id="@+id/text"
android:layout_toEndOf="@+id/thumb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dip"
android:layout_marginLeft="10dip"
android:layout_centerVertical="true"
android:singleLine="true"
android:ellipsize="end"
android:textStyle="bold"/>
</RelativeLayout>
下面请看我修改之后的预览效果: