
例如,我希望用户输入editText字符串,如用户#1234
在这个字符串中,用户#应该是文本之后的数字会有所不同,以便当用户尝试输入光标时,1234应该显示为提示,#1234提示将在用户输入字符时消失.
请指导我如何做到这一点.
谢谢
解决方法 我设法通过一些技巧和边缘和填充来实现这一点这就是我做的
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:padding="10dp" ><TextVIEw androID:layout_wIDth="40dp" androID:layout_height="wrap_content" androID:layout_margintop="10dp" androID:gravity="right" androID:text="user#" /><EditText androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:hint="1234" androID:paddingleft="40dp" androID:textSize="14sp" /></relativeLayout>
希望这会帮助你
总结以上是内存溢出为你收集整理的android – 同时在editText中提示和文本全部内容,希望文章能够帮你解决android – 同时在editText中提示和文本所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)