u can try getTop getPaddingTop as well Margins getLayoutParams and from there getting margins leftmargin
you can google to find more info. With those info you can properly identify what the initial adjustment will be it can be like start from paddingtop hope it helps On Fri, May 7, 2010 at 9:36 AM, Vincent Tsao <caojunvinc...@gmail.com>wrote: > 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<android-developers%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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