简体   繁体   中英

How do I make EditText show my text input?

I created a login screen with textinput, but I noticed that whenever I entered a character into the editText, it wouldn't show the letters I typed in. I'd greatly appreciate if you helped me with this.

My EditText code:

<EditText
        android:id="@+id/editText"
        android:layout_width="wrap_content"
        android:layout_height="44dp"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:alpha="0.23"
        android:background="@drawable/textviewshape"
        android:ems="10"
        android:inputType="textPersonName"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.709"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintStart_toEndOf="@+id/btnLogin"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.427" />

尝试将EditText属性android:textColor更改为黑色,或尝试删除背景。

您可以给android:textColor=""清楚地看到您在android:background="@drawable/textviewshape"给定的背景色

Why did you set this attribute:

android:alpha="0.23"

this will make the text unreadable.
Remove it and if the problem persists try a different textColor .

尝试更改文本的颜色和大小。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM