Suffix / Prefix TextInputLayout

I want to add suffix to TextInputLayout. The example is taken from material.io

Example

Are there standard solutions?

+3


source to share


1 answer


No standard solutions, I did it with a textView to the right of the textInputLayout and editing the text.



        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:gravity="bottom">

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Hint"
                app:errorEnabled="true">

                <android.support.v7.widget.AppCompatEditText
                    style="@style/RegistrationEditText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingRight="80dp" />
            </android.support.design.widget.TextInputLayout>

            <android.support.v7.widget.AppCompatTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerInParent="true"
                android:paddingBottom="12dp"
                android:paddingRight="8dp"
                android:text="rightLabel" />
        </RelativeLayout>

      

+3


source







All Articles