这个是listview的item布局,当在list中滚动时,每个item的高度会随机变化,导致显示混乱,多滚动几次高度又显示正常了,怎么回事呢?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#ffffff"
android:padding="6dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<TextView
android:id="@+id/msgin_sendtime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2015-01-01 12:00:00"
style="@style/chat_text_date_style"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<!-- 2017.12.27.zhaoyudan.start -->
<TextView
android:id="@+id/showId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:clickable="false"
android:focusable="false"
android:gravity="left|center"
android:text="46040928"
android:textColor="#000000"
android:textSize="10sp"
/>
<!-- 2017.12.27.zhaoyudan.end -->
</LinearLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:layout_marginTop="5dp" >
<ImageView
android:id="@+id/msgout_userhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/message_person"
android:focusable="false" />
<TextView
android:id="@+id/msgout_chatcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/msgout_userhead"
android:background
="@drawable/message_own"
android:clickable="true"
android:focusable="true"
android:gravity="left|center"
android:lineSpacingExtra="2dp"
android:maxWidth="200dp"
android:minHeight="50dp"
android:textColor="#ffffff"
android:textSize="15sp" />
<ImageView
android:id="@+id/msgout_sendState"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/msgout_chatcontent"
android:src="@drawable/message_sending" />
<TextView
android:id="@+id/msgin_chatcontent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@+id/msgin_userhead"
android:background="@drawable/message_adverse"
android:clickable="true"
android:focusable="true"
android:gravity="left|center"
android:lineSpacingExtra="2dp"
android:maxWidth="200dp"
android:minHeight="50dp"
android:textColor="#000000"
android:textSize="15sp" />
<ImageView
android:id="@+id/msgin_userhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/msg_duoxuan"
android:background="@drawable/message_person"
android:focusable="false" />
<!-- 2017.09.12赵宇丹修改 -->
<CheckBox
android:id="@+id/msg_duoxuan"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_alignBaseline="@+id/msgin_chatcontent"
android:layout_alignBottom="@+id/msgin_chatcontent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:visibility="gone"
android:clickable="false"
android:enabled="false"
android:focusable="false"
android:focusableInTouchMode="false" />
<!-- end -->
</RelativeLayout>
</LinearLayout>