Lazylist Layout

ぐ巨炮叔叔 提交于 2019-12-14 03:09:06

问题


I created my own Lazylist which originally created by Fedor here(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?


回答1:


modify your item.xml like this way

<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>


来源:https://stackoverflow.com/questions/7620026/lazylist-layout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!