我怎麼能中心的ImageButton在此的LinearLayout安卓:中心的ImageButton在LinearLayout中
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/main"
>
的ImageButton
<ImageButton android:id="@+id/btnBut"
android:background="@drawable/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
我不希望使用固定的尺寸。
感謝
我嘗試這個,但ImageButton中心只水平,我想在屏幕中心。你可以幫我嗎 ?謝謝 – Jovan 2010-09-27 18:06:00
你可以發佈整個佈局嗎? – 2010-09-27 18:40:05
我用RelativeLayout和android:layout_centerInParent =「true」 – Jovan 2010-09-27 18:53:23