2010-10-18 57 views

回答

0
<RelativeLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    > 
    <View android:id="@+id/view1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     /> 
    <View 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_toRightOf="@id/view1" 
     android:layout_centerVertical="true" 
     /> 
</RelativeLayout> 

類似的東西?

+0

不是。第二個視圖必須以第一個視圖的高度爲中心,而不是以父視圖的高度爲中心。而且我不能將它們放在攤位中,因爲父母必須和屏幕一樣大,而且視圖必須放在上面。 – Gratzi 2010-10-18 14:56:04

+0

啊,我明白了。那麼你唯一的選擇是使用第二個'RelativeLayout'來保存這兩個視圖,並且它與父親'RelativeLayout'的頂部對齊。 – Felix 2010-10-18 14:59:09

相關問題