2017-07-22 44 views
0

无论何时我想在EditText字段中编写一个字符串,默认消息(例如本例中的“输入消息”)不会被删除,而必须手动删除它才能看到我的字符串。现在,如果我输入一个新的字符串,它会附加到EditText中的输入消息字符串。Android Studio EditText默认字符串

是否有任何方式在EditText中的默认字符串被删除,只要我输入一个字符串?

Typing a new string adds the string to the beginning of the default message

回答

1

请勿使用'文本'。使用

<EditText 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:hint="Enter a message" 
    />