It remind me of considering some margin space, so i change my code 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; } * int posY = 5; // i guess the margin-top may be 5 px :)* for (int i = 1; i < count; i++) { *posY += line_height;* canvas.drawLine(0, posY, getRight(), posY, linePaint); canvas.save(); } super.onDraw(canvas); canvas.restore(); } finally it looks right, so i'm sure there is a margin space between my EditText and the default view , but i have no idea about how to get this height? so i hard code it 5 px any suggestion? -- 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