0
我想做一个列表,其中每行有一个文本在顶部和底部和另一个图像对齐右(如附图)。ListActivity布局自定义
但我不能。任何人都可以帮我吗?
样本图像:
http://www.freeimagehosting.net/uploads/fb6e2055f5.png
我想做一个列表,其中每行有一个文本在顶部和底部和另一个图像对齐右(如附图)。ListActivity布局自定义
但我不能。任何人都可以帮我吗?
样本图像:
http://www.freeimagehosting.net/uploads/fb6e2055f5.png
有大量的教程和关于它的问题。
仅举几个从谷歌搜索:
我没有测试它,但你行的XML应该是这样的这个:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/green_title"
android:textSize="25sp"
android:textColor="#00FF00"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="Text1"/>
<TextView android:id="@+id/sub_title"
android:textSize="15sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/green_title"
android:text="Text2"/>
<ImageView android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image"
android:layout_alignParentRight="true"
android:layout_below="@id/green_title"/>
</RelativeLayout>
想要图像对齐:( – Sand 2010-06-26 16:15:14
@Sand:检查第一个链接。它讨论了一个row.xml。在那里你会为每一行做你自己的看法。使用RelativeLayout或LinearLayout并将图像放在右侧,就是这样。 – Macarse 2010-06-26 16:20:42
但你如何对齐右侧的图像? – Sand 2010-06-26 16:40:01