2013年3月9日 星期六

Android layout

Review Android Layout

 <?xml version="1.0" encoding="utf-8"?>  
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"   
           android:id="@+id/relativeLayout1"  
           android:layout_width="fill_parent"   
           android:layout_height="fill_parent"  
           >  
           <LinearLayout   
                android:id="@+id/LinearLayout02"   
                android:layout_height="wrap_content"  
                 android:layout_width="fill_parent"  
                 android:layout_alignParentBottom= "true">  
                 <Button   
                      android:layout_width="fill_parent"  
                      android:layout_weight="1"  
                     android:layout_height="wrap_content"   
                     android:text="exit"   
                     android:id="@+id/btExit"  
                     android:layout_alignParentBottom= "true"/>  
                <Button   
                     android:layout_width="fill_parent"  
                     android:layout_weight="1"  
                     android:layout_height="wrap_content"   
                     android:text="add"   
                     android:id="@+id/btAdd"  
                     />  
                <Button   
                     android:layout_width="fill_parent"   
                     android:layout_weight="1"  
                     android:layout_height="wrap_content"   
                     android:text="test"   
                     android:id="@+id/btTest"  
                     />  
            </LinearLayout>       
      <FrameLayout   
           android:id="@+id/frameLayout1"  
            android:layout_width="fill_parent"   
            android:layout_height="fill_parent"  
            android:layout_above= "@+id/LinearLayout02">  
            <Button  
                android:id="@+id/btframeLayout"  
                android:layout_width="fill_parent"  
                android:layout_height="fill_parent"  
                android:text="framelayout"/>  
      </FrameLayout>  
 </RelativeLayout>  


效果如下:



Ref.
http://corn0521.blogspot.tw/2011/04/android-relativelayout.html