G
G
gibsonen2019-02-01 12:18:22
Android
gibsonen, 2019-02-01 12:18:22

How to align a spinner to the right?

The usual standard spinner with a text list is used. I want to align it to the right along with the title. How to do it? Below xml

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingTop="15dp"
        android:paddingBottom="15dp">

        <TextView
            android:layout_marginLeft="15dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="15dp" />
        <Spinner
            android:id="@+id/state_brigade_spinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end" />

    </LinearLayout>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2019-02-01
@iLLuzor

align

https://ru.wiktionary.org/wiki/align
You need to add an attribute to the LinearLayout:
android:gravity="end"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question