1

月曜日から木曜日までは適切に調整されていることがわかるように、すべての時間が正当化される (つまり、同じマージンで開始および終了する) ことを確認しようとしています。金曜日と土曜日の 11:00 は、残りの時間と適切に調整されていません。03:00 と 01:00 が異なる量のスペースを占めるため、間違いありません。しかし、それらをすべて完全に整列させる方法はありますか?

<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>

時間調整されていません

4

3 に答える 3

0

次のことを試してください。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingTop="@dimen/margin_3times" >

    <com.example.views.TextView
        android:id="@+id/openhour_day"
        android:layout_width="0px"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        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_gravity="left"
        android:layout_weight="2"
        android:textColor="@color/gray_dark"
        android:textSize="@dimen/middle_text_size"
        android:singleLine="true"
        android:text="Hour" />

</LinearLayout>
于 2013-08-12T16:43:03.963 に答える