textView without any default padding while increasing size of textView [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-19 10:32:36

问题


I want to remove default padding on textView. when i increase the size of textView then it's 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.

first image

second image


回答1:


Maybe this help you

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="0dip"
        android:layout_margin="0dip"
        android:background="@android:color/transparent" />

Edit: Try this two attributes:

        android:maxWidth="...dip"
        android:maxHeight="...dip"



回答2:


Try android:includeFontPadding="false" or set the height as same as text size instead of "wrap_content"



来源:https://stackoverflow.com/questions/12172210/textview-without-any-default-padding-while-increasing-size-of-textview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!