XML : Setting the `textSize` in sp to `textView` does not work

I'm trying to set the textSize in sp to textView to be seen correctly on all devices. This is my code:

  <TextView      android:layout_width="wrap_content"      android:layout_height="wrap_content"      android:text="Hello World!"      android:layout_alignParentTop="true"      android:layout_centerHorizontal="true"      android:textSize="30sp" />    

On a low resolution device the text is like this:
enter image description here On a medium resolution device the text is like this:
enter image description here On a high resolution device the text is like this:
enter image description here

I need that text to be seen correctly on all devices. I tried to use android:textSize="30dp" but same result. Where am i wrong? Thnaks!

No comments:

Post a Comment