我正在嘗試在我的Android應用程序頂部創建一個條,該條有三個按鈕和一個徽標,最左側的一個按鈕,中心的徽標和右側的兩個按鈕。我的問題是,右側的兩個按鈕重疊,我怎麼讓他們都在右側,但沒有堆疊?Android View Layout
這裏是我認爲XML結構:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="42px"
android:orientation="horizontal"
android:background="@drawable/header_background">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Button android:id="@+id/button_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:background="@drawable/menu_button"
android:layout_gravity="left"
android:layout_alignParentLeft="true" />
<ImageView
android:id="@+id/imageViewLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo_white"
android:layout_centerInParent="true"/>
<Button android:id="@+id/button_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:background="@drawable/camera_button"
android:layout_gravity="right"
android:layout_alignParentRight="true" />
<Button android:id="@+id/button_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:background="@drawable/two_up_button"
android:layout_gravity="right"
android:layout_alignParentRight="true" />
</RelativeLayout>
</LinearLayout>
任何意見將是巨大的!謝謝。
感謝您的幫助 – 2013-03-12 15:20:47