如何将微调器项设置为右侧?

问题描述 投票:0回答:1

你能帮帮我吗,我怎样才能将微调器项目设置为右侧,因为现在正对齐。此外,我试图将对齐更改为正确,但没有奏效。

在设计视图中:

https://imgur.com/nzHcxS0  "Actual Design View"

XML版本:

<?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:gravity="center_vertical"
    android:orientation="horizontal">


    <EditText
        android:id="@+id/editTextNumberField"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="6"
        android:inputType="number" />

    <Spinner
        android:id="@+id/spinnerNumberFieldUnits"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:gravity="center">
    </Spinner>


</LinearLayout>
android layout
1个回答
0
投票

我解决了我只需要将android:layout_weight写为0,这个想法比右边更好。 Ty @jesu

© www.soinside.com 2019 - 2024. All rights reserved.