How do I reduce the padding around text in Android xml layout?

前端 未结 4 1095
故里飘歌
故里飘歌 2021-01-05 23:49

I have 1 inch high text but the box of the view takes up 1.5 inches so there is 1/4 inch of black space above and below the white lettering. I want to reduce that 1/4 inch

相关标签:
4条回答
  • 2021-01-06 00:14

    Have you tried this?:

    android:padding="5dp"
    
    0 讨论(0)
  • 2021-01-06 00:15

    Some negative top and bottom margin. Things get messy though if you have fancy backgrounds.

    0 讨论(0)
  • 2021-01-06 00:23

    I think the problem is due to padding/margin set in textTimeToPin view. If you have set any spacing to this view so it will affect the placement of textTimeToCB since it is set to be displayed below it.

    Review your xml for surrounding views or paste it entirely for us to have a better observation.

    0 讨论(0)
  • 2021-01-06 00:27

    Use negative values in the padding element.

    0 讨论(0)
提交回复
热议问题