在我的應用程序中,我想在頁面的底部放置5個圖像按鈕。在5個按鈕中,我想要兩個按鈕位於屏幕的右側和左側角落,而一個按鈕正好位於屏幕的中央。另外兩個按鈕必須放置在這些按鈕之間,並且它們之間必須有相同的空間。我希望這是爲所有設備共同創建的。ImageButton在Android應用程序中的相對佈局問題
以下是我的佈局:
<RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content">
<RelativeLayout android:background="#ffffff" android:layout_width="fill_parent" android:layout_alignParentBottom="true" android:id="@+id/relativeLayout1" android:layout_height="wrap_content">
<ImageButton android:layout_alignParentLeft="true" android:id="@+id/widget32" android:layout_width="wrap_content" android:background="@drawable/back" android:layout_height="wrap_content">
</ImageButton>
<ImageButton android:layout_toRightOf="@+id/widget32" android:id="@+id/widget33" android:layout_width="wrap_content" android:background="@drawable/thumbsup" android:layout_height="wrap_content">
</ImageButton>
<ImageButton android:layout_centerInParent="true"android:layout_toRightOf="@+id/widget33" android:id="@+id/flipme" android:layout_width="wrap_content" android:background="@drawable/flip" android:layout_height="wrap_content">
</ImageButton>
<ImageButton android:layout_toRightOf="@+id/flipme" android:id="@+id/widget35" android:layout_width="wrap_content" android:background="@drawable/thumbsdown" android:layout_height="wrap_content">
</ImageButton>
<ImageButton android:layout_alignParentRight="true" android:id="@+id/widget36" android:layout_width="wrap_content" android:background="@drawable/forward" android:layout_height="wrap_content">
</ImageButton>
</RelativeLayout>
</RelativeLayout>
我想設置的順序所有這些圖片,請幫助我。
現在我有一個新問題。我試着在1.5和2.1版本的設備上運行這段代碼。 在2.1中,佈局工作正常,但在1.5版本的設備中,按鈕呈鋸齒形。這是爲什麼?請幫幫我。
我無法將其更改爲任何其他佈局,因爲它會影響我的其他代碼。所以請給我一個相對佈局本身的解決方案。
我的佈局的曲折形狀順序是這條線的第三個圖像按鈕「android:layout_centerInParent =」true「;」爲什麼這樣,任何人都可以解釋我..... –