'EditText not showing the hint or the outline box until focused
I saw that there are numerous threads raised on this topic but none of them seems to solve my issue.
I have an EditText inside of InputLayout and it shows blank until focused.
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginTop="20dp"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:hint="Name"/>
Solution 1:[1]
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black"
android:layout_marginTop="20dp"
app:boxStrokeWidth="2dp"
android:textColorHint="@color/black"
>
<EditText
android:id="@+id/etInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
/>
</com.google.android.material.textfield.TextInputLayout>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

