Monday, 12 August 2013

Android justifying android text

Android justifying android text

I am trying to make sure that the hours are all justified (meaning they
begin and end at the same margin) as you can see from Monday-Thursday they
align properly. Friday and Saturday the 11:00 is not aligned properly with
the rest. No doubt because of the 03:00 and 01:00 taking different amount
of space. But is there a way to make them all align perfectly?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/margin_3times"
android:orientation="horizontal"
android:weightSum="1"
>
<com.example.views.TextView
android:id="@+id/openhour_day"
android:layout_width="0px"
android:layout_weight="0.9"
android:layout_height="wrap_content"
android:textColor="@color/gray_dark"
android:textSize="@dimen/middle_text_size"
android:text="Day"/>
<com.example.views.TextView
android:id="@+id/openhour_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:singleLine="true"
android:textColor="@color/gray_dark"
android:textSize="@dimen/middle_text_size"
android:text="Hour"/>
</LinearLayout>

No comments:

Post a Comment