I
I
ilitaexperta2018-04-27 05:18:25
Android
ilitaexperta, 2018-04-27 05:18:25

Why does the Spinner move out next to the TextInputLayout?

I made a layout where TextInputLayout and Spinner lie next to each other.
This is how it looks in the editor:
oZaE5.png
This is how it looks on a device with 6.1 and on an emulator with 8.0:
Ft8ig.png
And this is how it is on a fetid Samsung with 5.1:
Ejwzv.png
And I tried to set the background to all elements in the layout with different colors, and the layout is correct, just wry-handed Koreans draw a line Spinnner is not where it should be:
iJaqq.png
I need a TextInputLayout to display errors, but I think it messes up with a regular EditText too.
Someone has come across anyone, many people use these Samsungs.
Here is the layout itself:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:padding="18dp"
        tools:context="com.app.MyActivity" >

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="-10dp">

            <android.support.design.widget.TextInputLayout
                android:id="@+id/layout_new_amount"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                app:errorEnabled="true"
                app:hintEnabled="false">

                <EditText
                    android:id="@+id/edit_new_amount"
                    android:layout_width="match_parent"
                    android:layout_height="46dp"
                    android:ems="10"
                    android:hint="@string/hint_amount"
                    android:inputType="number|numberDecimal"
                    android:singleLine="true" />
            </android.support.design.widget.TextInputLayout>

            <Spinner
                android:id="@+id/spinner_currency"
                style="@style/Base.Widget.AppCompat.Spinner.Underlined"
                android:layout_width="98dp"
                android:layout_height="46dp"
                android:spinnerMode="dialog"/>

        </LinearLayout>
    </LinearLayout>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Odisseya, 2018-04-27
@Odisseya

Indeed, it looks like a problem due to typography. On Samsung, the baseline went wrong and the font is different:
What emulator do you use?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question