How to remove the top and bottom space on textview of Android?

Just wanted to add to DynamicMind s answer that the reason why you see spacing around your TextViews is padding in 9-patch backgrounds they use by default 9-patch technology allows you to specify a content area which is, effectively, padding. That padding is used unless you set the view's padding explicitly. E.g.

, when you programmatically set a 9-patch background to a view which had paddings set, they are overridden. And vise-versa, if you set paddings they override what was set by 9-patch background Unfortunately, in the XML layout it's not possible to determine the order of these operations. I think just removing the background from your TextViews would help: android:background="@null.

Just wanted to add to DynamicMind's answer that the reason why you see spacing around your TextViews is padding in 9-patch backgrounds they use by default. 9-patch technology allows you to specify a content area which is, effectively, padding. That padding is used unless you set the view's padding explicitly.E.g.

, when you programmatically set a 9-patch background to a view which had paddings set, they are overridden. And vise-versa, if you set paddings they override what was set by 9-patch background. Unfortunately, in the XML layout it's not possible to determine the order of these operations.

I think just removing the background from your TextViews would help: android:background="@null.

For example: android:layout_marginTop="5dp" Otherwise, if your text view is wrapped inside a LinearLayout or other container, then that cold have either padding or a margin too.

Android:background="@android:drawable/editbox_background" use it according to you change it that you want editbox_background. Because android provide some build in background like above code choose according to your requirement. May be it is help full to you.

Try android:includeFontPadding="false" to see if it helps. In my experience that will help a little bit, but there's no way of reducing the TextView dimensions to the exact pixel-perfect text size. The only alternative, which may or may not give better results, is to cheat a bit and hard-wire the dimensions to match the text size, e.g."24sp" instead of "wrap_content" for the height.

How to remove the top and bottom space on textview of Android - Stack Overflow.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions