Lazylist布局 [英] Lazylist Layout

查看:190
本文介绍了Lazylist布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造了我自己的Lazylist它最初是由费多尔创建here(http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview).我努力使自己的自定义布局,看起来像下面的图片。反正有没有做到这一点?

I created my own Lazylist which originally created by Fedor here(http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview). I am trying to make my own custom Layout which looks like the image below. Is there anyway to accomplish this?

推荐答案

修改 item.xml 像这样

<RelativeLayout android:layout_height="55sp"
        android:layout_width="fill_parent" android:padding="5sp" android:layout_marginLeft="6sp"
        android:layout_marginRight="6sp" android:layout_marginBottom="3sp"
        android:layout_marginTop="3sp">         
    <ImageView android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true" android:layout_marginRight="6dip"
        android:id="@+id/image" android:layout_height="50sp"
        android:layout_width="50sp" android:src="@drawable/icon"/>
    <TextView android:id="@+id/title" android:layout_width="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true" android:ellipsize="marquee"
        android:layout_toRightOf="@+id/image" android:maxLines="1"
        android:gravity="center_vertical" android:layout_height="wrap_content" android:text="Hello"/>
    <TextView android:layout_width="fill_parent"
        android:id="@+id/desc"
        android:layout_alignParentRight="true" android:layout_alignParentTop="true"
        android:layout_above="@+id/title"
        android:layout_alignWithParentIfMissing="true" android:gravity="center_vertical"
        android:textStyle="bold" android:layout_toRightOf="@+id/image"
        android:layout_height="fill_parent" android:textSize="15sp" android:text="Title"/>
</RelativeLayout>

这篇关于Lazylist布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆