2011-06-08 105 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