用RelativeLayout实现左中右三部分显示(转)

<?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">  
  <ImageView  
    android:id="@+id/icon_left"  
    android:layout_width="wrap_content"  
    android:layout_height="wrap_content"  
    android:layout_alignParentLeft="true"  
    android:src="@drawable/icon"  
    />  
  <Button  
    android:id="@+id/button"  
    android:layout_width="wrap_content"  
    android:layout_height="wrap_content"  
    android:layout_alignParentRight="true"  
    android:text="button"  
    />     
  <LinearLayout  
    android:orientation="vertical"  
    android:layout_width="fill_parent"  
    android:layout_height="wrap_content"  
    android:layout_toLeftOf="@id/button"  
    android:layout_toRightOf="@id/icon_left"  
    >  
    <TextView  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:text="trust you"  
        />  
    <TextView  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:text="aaaaa"  
        />  
  </LinearLayout>       
</RelativeLayout> 

posted on 2010-08-18 11:00  lbeing  阅读(2467)  评论(0编辑  收藏  举报

导航