カスタムアダプターを備えた ListView と、このリスト内のアイテムのレイアウトがあります。アイテムのレイアウトは、ImageView を備えた単なる TextView です。画像は画面の右側に配置する必要があります。ただし、TextView 内のテキストの長さによっては、画像の位置が少しずれています。これは次のようになります。
これは私のXMLコードです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical" >
<TextView
android:id="@+id/txtCategoryName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:singleLine="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textColor="@color/list_text_color"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:id="@+id/imgArrowRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/right_arrow_44"
android:contentDescription="@string/img_description_right_arrow"
android:layout_gravity="right" />
</LinearLayout>
ナッジせずに、画像を常に右に揃えるにはどうすればよいですか?