Floating label needs to show inside the textinput layout in android studio

孤街醉人 提交于 2021-02-05 11:28:26

问题


I have set a text input floating button But it shows the floating label outside the input box. How can I show inside the input box in android?

 <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/text_input_layout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:textColorHint="@color/white_new"
                app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout"
                android:hint="@string/label">
                <EditText
                    android:id="@+id/et_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="20dp"
                    android:layout_marginStart="20dp"
                    android:padding="12dp"
                    android:gravity="left"
                    android:focusable="true"
                    android:focusableInTouchMode="true"
                    android:background="@drawable/edit_textinput_box"
                    android:layout_marginBottom="25dp"
                    android:hint="@string/name"
                    android:inputType="placeholder"
                    android:textColor="@color/white_new"
                    android:textColorHint="@color/white_new" />
            </com.google.android.material.textfield.TextInputLayout>

来源:https://stackoverflow.com/questions/65367815/floating-label-needs-to-show-inside-the-textinput-layout-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!