如何設置按鈕,如上圖所示。在ios中它被稱爲麪包屑風格。
我試着將按鈕放在相對佈局中,一個按鈕位於中間,另兩個位於兩側,但所有按鈕之間仍存在差距,在不同的設備中它看起來非常可怕。
以下是我的xml文件:
<RelativeLayout
android:id="@+id/TBtnLayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:background="@drawable/title_bar">
<ImageButton
android:contentDescription="@string/btn_desc"
android:id="@+id/left_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/center_btn"
android:background="@drawable/s_unsel_btn">
</ImageButton>
<ImageButton
android:contentDescription="@string/btn_desc"
android:id="@+id/center_btn"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:background="@drawable/c_unsel_btn">
</ImageButton>
<ImageButton
android:contentDescription="@string/btn_desc"
android:id="@+id/right_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/center_btn"
android:background="@drawable/t_sel_btn">
</ImageButton>
</RelativeLayout>
我的API級別是14,是否有任何示例代碼或教程。 Android的填充不工作....任何如何thanx –