9 patch image as background for TextInputEditText and icon position

134 Views Asked by At

I set a 9 patch image as background on the TextInputEditText layout. The problem is that the error icon and the eye icon are on the wrong position:

enter image description here

How can i fix?

<com.google.android.material.textfield.TextInputLayout
                        android:id="@+id/textInputLayout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:errorText="@{viewModel.passwordError}"
                        
                        app:passwordToggleEnabled="true">

                        <com.google.android.material.textfield.TextInputEditText
                            android:id="@+id/login_editText_password"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:hint="@string/fui_password_hint"
                            android:imeOptions="actionDone"
                            android:inputType="textPassword"
                            android:background="@drawable/shadow_form"
                            android:text="@={viewModel.passwordLoginValue}"
                            android:afterTextChanged="@{() -> viewModel.onCredentialsTextChanged()}" />

                    </com.google.android.material.textfield.TextInputLayout>
0

There are 0 best solutions below