2010-06-26 113 views

回答

3

有大量的教程和关于它的问题。

仅举几个从谷歌搜索:

我没有测试它,但你行的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> 
+0

想要图像对齐:( – Sand 2010-06-26 16:15:14

+0

@Sand:检查第一个链接。它讨论了一个row.xml。在那里你会为每一行做你自己的看法。使用RelativeLayout或LinearLayout并将图像放在右侧,就是这样。 – Macarse 2010-06-26 16:20:42

+0

但你如何对齐右侧的图像? – Sand 2010-06-26 16:40:01