Possible Duplicate:
I want textView without any default padding while increasing size of textView
I want to remove default padding on TextView. When i increase the size of TextView then its padding size increases automatically. even i set background of text View as "@null". i just want to show only text without any padding. my View looks like this first images and i want to show like second images.
This First link shows View is displaying.
http://www.imageurlhost.com/images/487vskfx1aj01f9e9g40.png
This second link show Layout view that i want to show without giving any -margin
It's called font padding. You can disable it with
mTextView.setIncludeFontPadding(false);
or xml attributeandroid:includeFontPadding="false"
You can remove the padding from xml by setting the
padding
to0dp
Try something like this:
Note that if you do that, you can't use
gravity
anymore, since that is working using padding.If you want to remove only top and bottom padding, you can set
paddingBottom
andpaddingTop
to0dp
and work with the side padding.Cheers, Arkde