Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 editText 中输入文本时,它应该会自动为我输入的文本添加下划线。当我继续在 editText 中输入文本时,我需要它像在背景中一样绘制。
有人能帮我吗。
使用高度为 1 dp 的视图和带有绿色背景的自定义宽度,在您的 editText 上的框架布局内,并处理与处理 image_width 相同的 custom_width。
对于下划线效果,EditText您需要添加此
EditText
//initialize edittext before editText.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG);