开发者

How to add watermark in android widget EditText?

开发者 https://www.devze.com 2023-03-05 06:27 出处:网络
Please provide the implementation of watermark text in开发者_如何学JAVA EditText widget of android,even after Googling it, but cannot find proper solution!If by \"watermark text\" you mean the text wh

Please provide the implementation of watermark text in开发者_如何学JAVA EditText widget of android,even after Googling it, but cannot find proper solution!


If by "watermark text" you mean the text which appears in the field when it is empty, then use the attribute android:hint="My Text" in the layout or programmatically call setHint( "My Text" ) on your EditText object.


You can add a layout make its height and width fill_parent and make background transparent and add a TextView as a water-mark in this layout.

I hope it can work.

0

精彩评论

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