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

前端 未结 14 1795
执笔经年
执笔经年 2020-11-28 04:58

When I include the below XML to layout file, I can see the below image. If you see it, you could realize that the TextView has top and bot

相关标签:
14条回答
  • 2020-11-28 05:41
    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.

    0 讨论(0)
  • 2020-11-28 05:43

    My way for fixing this is pretty hacky, but I managed to get the text to sit where I wanted by setting the height of the text view as static and fiddling with it until it just barely fit the text. In my case, the font style I was using had a height of 64sp so I set the height of my textview to 50sp and it worked okay. I also had to set foreground_gravity to bottom.

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