Я использую Android TextInputLayout для отображения плавающей метки в EditText.
Но я хочу показать ProgressBar слева от EditText, поэтому я добавил относительный макет внутри TextInputLayout и EditText внутри этого относительного макета.
при этом плавающая метка не работает.
Если я удалю относительный макет из TextInputLayout и сделаю его прямыми дочерними элементами EditText, тогда это сработает.
Так что EditTExt должен быть прямым дочерним элементом TextInputLayout, и если да, то как мы можем поместить другой виджет в EditTexts, оставленный как ProgressBar.
Поскольку TextInputLayout унаследован от LinearLayout, добавление к нему дочерних элементов добавит дочерние элементы по вертикали, но я хочу добавить представления поверх EditText.
<android.support.design.widget.TextInputLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/holderName"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/etField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
>
</android.support.design.widget.TextInputEditText>
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyle"
android:layout_width="16dp"
android:layout_height="match_parent"
android:indeterminateTint="@color/primary"
android:layout_gravity="right|center_vertical"
android:layout_marginRight="15dp"
android:visibility="visible"
/>
</FrameLayout>