I made a TextView which has attributes of background, gravity and so on. and i made a drawable resource file for the TextView's background. and this is the xml.
and i added the drawable resource into background of the TextView.
but the problem is, the background doesn't fit in Textview's bound. please look at this photo.
there is a gap very slightly. the background color area is upper than TextView's area. so i tried to use includeFontPadding attribute but it didn't work. how can i fix it?
I would advise you to check this on real device/emulator, not on preview in AS. use Show Layout Bounds option from developer options for verification, make some full-resolution screen shot and check on it. it will be properly placed
content of any View
, including its background, is always places inside its bounds. really, always, its just impossible to get outside with a single pixel (due to layout building and drawing mechanism)