2011-01-31 110 views
0

我可以在框架佈局內部使用相對佈局嗎?在這個ID =相對佈局02我想使用選項android:layout_below = relativelayout01但那不是所以我使用android:layout_marginTop =「100dip」,但這也是行不通的....我想把這relaytivelayout02下面相對layout01 ...怎麼可能?感謝您的幫助....如何在框架佈局內使用相對佈局

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" android:layout_height="wrap_content" 
    android:addStatesFromChildren="true" android:background="@drawable/mainscreen" 
    android:id="@+id/FrameLayout00"> 
    <RelativeLayout android:id="@+id/RelativeLayout01" 
     android:layout_width="fill_parent" android:layout_height="wrap_content"> 

     <TextView android:id="@+id/label" android:layout_width="wrap_content" 
      android:layout_height="wrap_content" android:textColor="#FFFFFF" 
      android:text="@string/title" android:textStyle="bold" 
      android:textSize="26sp" android:layout_marginTop="8dip" 
      android:layout_centerHorizontal="true" /> 


    </RelativeLayout> 

    <RelativeLayout android:id="@+id/RelativeLayout02" 
     android:layout_height="wrap_content" android:layout_width="96dip" android:layout_marginTop="100dip"> 
     <ImageButton android:layout_height="wrap_content" 
      android:layout_width="wrap_content" android:background="@android:color/transparent" 
      android:id="@+id/qutn" android:text="Question" android:textSize="16sp" 
      android:layout_alignParentLeft="true" android:textColor="@color/white" 
      android:layout_alignParentTop="true" android:layout_centerHorizontal="true" 
      android:layout_marginTop="15dip" android:src="@drawable/transprent"></ImageButton> 

回答

4

根據我的理解你的問題,我想你可以把你的這兩種佈局內的另一個(父)相對佈局。所以,你可以把你的第二個相對佈局放在你的第一個相對佈局下面。