我在使用following結構的項目中遇到問題。在每個仿真器(也是大屏幕)上,使用該代碼定位在簡單相對佈局內的按鈕相對佈局中的按鈕定位問題
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/first_bg" >
<Button
android:id="@+id/btnNext"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="202dp"
android:layout_marginRight="54dp"
android:background="@drawable/m_button"
android:text="@string/next" />
</RelativeLayout>
顯示正常。但在Galaxy Note上測試該應用程序顯示,該按鈕只能飛到一些瘋狂的位置。我使用了一個類似配置的仿真器,並且按鈕正常顯示。我不知道問題出在哪裏..
我猜你安排按鈕的上ADT-插件的GUI編輯器的地方,它給你這些利潤。請嘗試直接在xml中編寫GUI或使用GUI,但要注意編輯器是否自己添加邊距。 – 2012-02-11 23:45:16
我已經嘗試了這兩種方式,還有一個線性佈局,用手定義的邊距..但是該死的按鈕只是不想在Galaxy Note上啓動應用時停留在適當的位置o_0 – Droidman 2012-02-11 23:55:38
清理項目並將其從電話。然後再次嘗試xml資源有時會混亂。但是,我猜你的xml有問題。你可以張貼截圖,看看它應該是什麼樣的,以及它現在的樣子是否與你嘗試過的最後一個xml一樣。 – 2012-02-11 23:58:48