How to set textView to string on Android

I give below the attributes that I use textView in my application. (Green text in the middle)

<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20sp" android:textStyle="bold" android:gravity="center_horizontal" android:text="10/9" android:id="@+id/estimate_fertility_date" /> 

However, there are gaps such as a rough image. I want to set these spaces, because when the App is initialized, it seems awful.

I researched for about 1 hour, and I found several answers, but they do not match the ones I want to get. stack overflow

enter image description here

+6
source share
2 answers

Adding negative values ​​to margin helps you?

 <TextView android:layout_marginTop="-10dp" /> 
+3
source

In a normal TextView not easy to get text without text. One way is to set the minus threshold for TextView or simply use textview.setIncludeFontPadding(false) to reduce the indentation to some extent.

0
source

Source: https://habr.com/ru/post/980262/


All Articles