
まず右側を適応させ、次に中央を適応させ、最後に左側を適応させなければならない。...
その難しさは、開発中、この種の問題の通常の設計方法は常にレイアウトの右側を絞ることであり、レイアウトの右側をサイズに適応させることは不可能であるという事実にある。.
この問題は、以下のようにレイアウトを入れ子にすることで解決できる。.
<RelativeLayout
android:paddingLeft="@dimen/x8"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/topName"
android:paddingLeft="@dimen/x18"
android:layout_marginTop="@dimen/x16"
android:layout_toLeftOf="@+id/check_box"
android:layout_marginRight="@dimen/x21"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="コース・ノード名 コース・ノード名 コース・ノード名 コース・ノード名 "
android:singleLine="true"
android:ellipsize="end"
android:layout_weight="1"
android:textColor="@color/c_2b2d44"
android:textSize="@dimen/x16"
/>
<TextView
android:id="@+id/item_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/x8"
android:paddingTop="@dimen/x2"
android:paddingBottom="@dimen/x2"
android:paddingLeft="@dimen/x4"
tools:text="
android:paddingRight="@dimen/x4"
android:background="@drawable/bg_corner_radius2_f1f1f1"
android:textColor="@color/c_6a6c7c"
android:textSize="@dimen/x10" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/check_box"
android:src="@drawable/icon_download_check_nomal_weektask"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/x18"
android:layout_marginTop="@dimen/x21"
android:layout_width="@dimen/x22"
android:layout_height="@dimen/x22"/>
</RelativeLayout>