How do I give space in between text in textview?

Steve picture Steve · Jul 3, 2014 · Viewed 31.3k times · Source

I need to make something like this according to Android screen bound,

 S             M             T              W               T              F               S

I am doing like this:

    <TextView
    android:id="@+id/textView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="45dp"
    android:text="S       M       T        W        T        F       S" />

This is not working properly, not according to device screen bound. I need something like this:

<TextView
    android:id="@+id/textView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="45dp"
    android:text="S""10dp""M""10dp""T""10dp""W""10dp""T""10dp""F""10dp""S""10dp" />

Answer

App Kart picture App Kart · Jul 3, 2014

We can use it.

<TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="A&#160;B&#160;&#160;&#160;&#160;&#160;C"/>