Relative Content

Tag Archive for androidnative

Why is Textview height larger than the text height in Android?

I’m trying to place an element under the Textview but there is too much space between them because the Textview has too much padding and this padding can’t be disabled.
I even tested it with just one element in the page and still it has the same problem:
<TextView android:id="@+id/textViewSpeed" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="test" android:textColor="@color/black" android:fontFamily="monospace" android:textSize="150sp" android:padding="0dp"/>

Why is Textview height larger than the text height in Android?

I’m trying to place an element under the Textview but there is too much space between them because the Textview has too much padding and this padding can’t be disabled.
I even tested it with just one element in the page and still it has the same problem:
<TextView android:id="@+id/textViewSpeed" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="test" android:textColor="@color/black" android:fontFamily="monospace" android:textSize="150sp" android:padding="0dp"/>