2011-06-08 59 views
0

我是Android的新手。我試圖做出如下圖的佈局,但我無法做到。 enter image description here我該如何製作這種佈局?

該矩形是一個圖像,其他兩個是文本視圖。我嘗試過,但總是錯的。期待聽到你們,感謝提前。

+0

你可以發佈你的代碼,並描述它的生產 – Jodes 2011-06-08 15:58:41

+0

我建議發佈一些代碼,然後我們可以建議它有什麼問題。 – AntonyW 2011-06-08 15:59:14

回答

0

定義一個佈局如下:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/rlGridRow" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"  
    > 
<ImageView  
    android:id="@+id/imageView01"  
    android:layout_width="36.0dip" 
    android:layout_height="36.0dip" 
    android:scaleType="fitCenter" 
    android:layout_alignParentLeft="true" /> 
<TextView android:id="@+id/txtLink1" 
    android:paddingLeft="6.0dip"  
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"  
    android:textColor="#FF00FF" 
    android:layout_toRightOf="@id/imageView01" /> 
<TextView android:id="@+id/txtLink2" 
    android:paddingLeft="6.0dip"  
    android:paddingBottom="8.0dip" 
    android:layout_width="wrap_content"  
    android:layout_height="wrap_content" 
    android:textColor="#00FFFF" 
    android:textSize="12sp" 
    android:layout_marginTop="-4.0dip" android:layout_toRightOf="@id/imageView01" 
    android:layout_below="@id/txtLink1" /> 
</RelativeLayout> 

this鏈接,瞭解更多信息。

+0

它的工作原理。感謝你的回答。 – Mike 2011-06-09 11:25:21