Home > Back-end >  xml custom editted text
xml custom editted text

Time:01-28

I want to make custom edit text like this :This is I want

but I tried to make it. It looks like this : This is wrong one

I use inputLayoutText when I enabled togglePassword masking my background how can i solve it.

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textColorHint="@color/textHint"
    app:endIconMode="password_toggle"
    app:endIconTint="@color/textHint"

    android:layout_marginStart="50dp"
    android:layout_marginEnd="42dp"
    android:layout_marginTop="10dp"
    android:hint="@string/password"
    app:hintTextColor="@color/textHint"
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
    >

    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/edittext_background"
        android:inputType="textPassword"
        />
</com.google.android.material.textfield.TextInputLayout>

I tried this it doesnt work.

CodePudding user response:

If shadow does not show then use cardview like this..

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardCornerRadius="25dp"
        app:cardElevation="8dp"
        app:cardBackgroundColor="#1E1E1E"
        app:cardUseCompatPadding="true">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@drawable/edittext_background"
            android:paddingHorizontal="16dp" />
        
    </androidx.cardview.widget.CardView>

  • Related