问题
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