我正在使用圖像按鈕創建一個應用程序,麻煩的是圖形佈局顯示按鈕與在仿真器上運行時不同的位置。我已經在plz幫助下面發佈了我的代碼。我已經提供了一個圖形佈局的Dropbox鏈接與模擬器上顯示的內容。圖像按鈕是紅色的播放按鈕,在左邊的圖片上它出現在模擬器上的邊界之外,它完全放置在紅色播放按鈕上。注意:我將一個按鈕放在同一個按鈕的圖像上。這裏是鏈接:https://dl.dropboxusercontent.com/u/8104708/Comparison.png圖像按鈕出現在仿真器上的不同位置比圖形佈局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/title_screen" >
<ImageButton
android:id="@+id/ibPlay"
android:layout_width="400dp"
android:layout_height="400dp"
android:layout_marginLeft="100dp"
android:layout_marginTop="310dp"
android:background="@drawable/box_side_red"
android:onClick="@drawable/box_side_red_pressed_shadow" />
</LinearLayout>
後的你... – CRUSADER
你可以張貼草圖你怎麼了你想要什麼,什麼截圖想要精確顯示imagebutton? –
你在「不同的地方」下有什麼不足?將截圖放在這裏,說出它在手機上的外觀以及它在仿真器上的外觀。或至少創建一個結果的scetch。 – g00dy