I want to add suffix to TextInputLayout. An example is taken from the material.io
Are there any standard solutions?
With the TextInputLayout
provided in the Material Components Library you can use the attrs:
app:prefixText
: prefix textapp:suffixText
: suffix textSomething like:
<com.google.android.material.textfield.TextInputLayout
android:hint="Test"
app:prefixText="@string/..."
app:prefixTextColor="@color/secondaryDarkColor"
app:suffixText="@string/..."
app:suffixTextColor="@color/primaryLightColor"
...>
<com.google.android.material.textfield.TextInputEditText
.../>
</com.google.android.material.textfield.TextInputLayout>
Example:
Note: This requires a minimum of version 1.2.0-alpha01
.