Недавно я работал над моим первым приложением для Android, которое конвертирует в различные единицы измерения температуры.У меня есть все реальное кодирование вниз, но у меня проблема с созданием графического интерфейса для него.Я использовал конструктор DroidDraw UI для генерации кода XML;Внутри DroidDraw я использую RelativeLayout во всем интерфейсе пользователя.Всякий раз, когда я создаю его в DroidDraw, он отлично выглядит в предварительном просмотре, но когда я пытаюсь запустить приложение, оно всегда выглядит как беспорядочный беспорядок:

Делает ли этоесть что-то из-за требований к разным размерам экрана, и если да, то как я могу это исправить?
Добавляя некоторую дополнительную информацию, я не запускаю ее через эмулятор;Я запускаю его на моем пленнике с экраном 480х800.Кроме того, я строю с использованием среды IDE NetBeans с плагином NBAndroid.
Вот мой файл [main.xml] [2]:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget32"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<EditText
android:id="@+id/input"
android:layout_width="100px"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_alignTop="@+id/output"
android:layout_alignParentLeft="true"
>
</EditText>
<TextView
android:id="@+id/widget42"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Output"
android:layout_below="@+id/ftok"
android:layout_alignLeft="@+id/ktoc"
>
</TextView>
<TextView
android:id="@+id/widget41"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Input"
android:layout_below="@+id/ftok"
android:layout_alignParentLeft="true"
>
</TextView>
<Button
android:id="@+id/ftok"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Far To Kel"
android:textStyle="bold"
android:layout_alignTop="@+id/ctok"
android:layout_alignParentLeft="true"
>
</Button>
<Button
android:id="@+id/ctok"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Cel To Kel"
android:textStyle="bold"
android:layout_alignTop="@+id/ktoc"
android:layout_alignLeft="@+id/ctof"
>
</Button>
<Button
android:id="@+id/ktoc"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Kel To Cel"
android:textStyle="bold"
android:layout_below="@+id/ctof"
android:layout_alignParentRight="true"
>
</Button>
<Button
android:id="@+id/ctof"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Cel To Far"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
>
</Button>
<Button
android:id="@+id/ktof"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Kel To Far"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
>
</Button>
<Button
android:id="@+id/ftoc"
android:layout_width="104px"
android:layout_height="wrap_content"
android:text="Far To Cel"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
>
</Button>
<TextView
android:id="@+id/widget50"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temperature Conversion is Fun!"
android:textSize="16sp"
android:textStyle="bold"
android:layout_below="@+id/widget49"
android:layout_toRightOf="@+id/widget41"
>
</TextView>
<TextView
android:id="@+id/widget49"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Kel=Kelvin"
android:layout_below="@+id/widget48"
android:layout_alignLeft="@+id/ctok"
>
</TextView>
<TextView
android:id="@+id/widget48"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cel=Celcius"
android:layout_below="@+id/widget47"
android:layout_alignLeft="@+id/ctok"
>
</TextView>
<TextView
android:id="@+id/widget47"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Far=Fahrenheit"
android:layout_below="@+id/input"
android:layout_alignLeft="@+id/ctok"
>
</TextView>
<EditText
android:id="@+id/output"
android:layout_width="100px"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_below="@+id/widget42"
android:layout_toRightOf="@+id/ctok"
>
</EditText>
</RelativeLayout>
Любая помощь будет принята с благодарностью.