У меня есть следующий код XML (частично для этого примера):Убедитесь, что EditText находится непосредственно под ярлыком с помощью LinearLayout
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="0dp"
android:paddingRight="0dp" >
<RadioGroup
android:id="@+id/rgVehicle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.5" >
<RadioButton
android:id="@+id/rbCar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="Car" />
<RadioButton
android:id="@+id/rbTruck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Truck" />
<RadioButton
android:id="@+id/rbCycle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Motorcycle" />
</RadioGroup>
<EditText
android:id="@+id/etToll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal"
android:layout_weight=".5" />
</LinearLayout>
Для меньшего экрана, как Galaxy Nexus и Nexus One макет выходит так:
Как я могу это исправить, так что EditText находится непосредственно под #6
этикетки не показан ниже (независимо от того, какого размера экрана):
Первое, что приходит на мой взгляд, является использование таблицы макета с двумя строками и двумя столбцами –
Как бы реализовать желаемое результат с этим макетом? – Si8