Ich benutze Android TextInputLayout, um Floating-Label auf EditText anzuzeigen.Viewgroup in einem TextInputLayout macht Floating-Label funktioniert nicht
Aber ich möchte eine ProgressBar auf der linken Seite von EditText zeigen, also habe ich ein relatives Layout innerhalb der TextInputLayout und EditText in diesem relativen Layout hinzugefügt.
damit das Floating-Label nicht funktioniert.
Wenn ich in das relative Layout von der TextInputLayout entfernen und die EditText Kinder direkt davon, dann funktioniert es.
Also muss EditTExt eine direkte Kinder von TextInputLayout sein und wenn ja, wie können wir ein anderes Widget zu EditTexts wie ProgressBar links legen.
Als TextInputLayout inhertis von LinearLayout, Kinder hinzufügen, fügt Kinder vertikal, aber ich möchte Ansichten über EditText hinzufügen.
<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>
wo ist Ihr Code Sir? – Remario
Ich habe den Code veröffentlicht, obwohl der Code FrameLayout als untergeordnete Elemente hat, nicht relatives Layout nach der Frage. –