开发者

how to remove default key word from emulater when user enter the text in edit text

开发者 https://www.devze.com 2023-02-16 09:39 出处:网络
how to remove default key word from e开发者_如何学JAVAmulater when user enter the text in edit textI think you need to have a default value in edit text that should be changed when user enters some te

how to remove default key word from e开发者_如何学JAVAmulater when user enter the text in edit text


I think you need to have a default value in edit text that should be changed when user enters some text, and if everything is removed that default text should come

In this case use that default text for hint property of that edit text

Suppose you want your default text Username

Use this code

<EditText
            android:id="id"
            android:layout_height="wrap_content"
            android:maxLines="1"
            android:lines="1"
            android:layout_width="fill_parent"
            android:textSize="11dp"
            android:background="@drawable/text_box"
            android:padding="5dp"
            android:hint="Enter Username here" />
0

精彩评论

暂无评论...
验证码 换一张
取 消