自定义的ListView?自定义、ListView

2023-09-03 20:58:08 作者:两腿间的梦

我有一个code。通过费奥多尔而成,可以发现here".

I have a code made by Fedor, it can be found "here".

第一个形象是什么,我现在有,

The first image is what I have now,

和第二图像是我想要实现的目标。

and the second image is what I want to accomplish.

有人能指导我与此有关。我一直在挣扎了几天的时间来解决这个问题。  请帮帮我,在此先感谢!

Can someone guide me with this. I have been struggling for days trying to solve this problem. Please help me, Thanks in advance!

推荐答案

您只需要修改列表项的布局(在item.xml)有另一个ImageView的。

You just need to modify the list item layout (in item.xml) to have another ImageView.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" android:layout_height="wrap_content">
    <ImageView android:id="@+id/image1" android:layout_width="50dip" 
        android:layout_height="50dip" android:src="@drawable/stub" 
        android:scaleType="centerCrop" /> 
    <ImageView android:id="@+id/image2" android:layout_width="50dip" 
        android:layout_height="50dip" android:src="@drawable/stub" 
        android:scaleType="centerCrop" /> 
    <TextView android:id="@+id/text" android:layout_width="fill_parent" 
        android:layout_height="wrap_content" android:layout_weight="1" 
        android:layout_gravity="left|center_vertical" android:textSize="20dip" 
        android:layout_marginLeft="10dip" /> 
</LinearLayout>

和修改LazyAdapter的getView()方法来添加支持第二ImageView的。

and modify LazyAdapter's getView() method to add support for the second ImageView.