Android - How to make all lines in an edittext underlined?

前端 未结 3 1518
情书的邮戳
情书的邮戳 2020-12-09 14:00

From the tutorial I have created the layout:

  public static class LinedEditText extends EditText {
        private Rect mRect;
        private Paint mPaint;         


        
3条回答
  •  一整个雨季
    2020-12-09 14:23

    As it is visible from your code, you are drawing underline for the edit text for lines from 0 to count in your for loop and count is set to int count = getLineCount();. So only the existing number of lines in the EditText will be incremented! By changing the number of count you can draw as many underlines as you want!

提交回复
热议问题