i have a customized LinkedEditText extends from EditText, and override the
onDraw method as below:

protected void onDraw(Canvas canvas) {
        canvas.drawColor(paperColor);

        int count = getLineCount();
        int height = this.getMeasuredHeight();
        int line_height = this.getLineHeight();
        int page_size = height / line_height + 1;

        if (count < page_size) {
            count = page_size;
        }

        for (int i = 1; i < count; i++) {
            int posY = i * line_height;

            canvas.drawLine(0, posY, getRight(), posY, linePaint);
            canvas.save();

        }

      super.onDraw(canvas);
      canvas.restore();
}

here is what this customized EdtiText looks like:

[image: new_note_1.png]


as you can see, the text line-height didn't match the lines which i draw.

but AK notes App did it perfect:

[image: ak_note_1.png]


any idea what' wrong did i do? thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

<<new_note_1.png>>

<<ak_note_1.png>>

Reply via email to