Как поместить изображение справа от радиокнопки, Android

Я пытаюсь составить список переключателей из 4 пунктов. Каждый элемент должен иметь текст справа, а также изображение справа от текста. Изображение - это не сам переключатель, это изображение, описывающее опцию. Мне пока не везет, дизайнер вроде бесполезно расставлять вещи по местам. Вы должны знать, как это кодировать в XML. Мой XML-код выглядит так:

<?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:weightSum="1" android:baselineAligned="true" android:orientation="horizontal">
    <RadioGroup android:layout_weight="0.50" android:layout_height="wrap_content" android:id="@+id/radioGroup1" android:layout_width="0dp">
        <RadioButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:checked="true" android:text="A" android:id="@+id/radio0"></RadioButton>
        <ImageView android:layout_toRightOf="@id/radio0" android:layout_height="wrap_content" android:src="@drawable/A2" android:layout_width="wrap_content" android:id="@+id/imageView1"></ImageView>
        <RadioButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="B" android:id="@+id/radio1"></RadioButton>
        <RadioButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="C" android:id="@+id/radio2"></RadioButton>
        <RadioButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="D" android:id="@+id/radio3"></RadioButton>
    </RadioGroup>

</LinearLayout>

Здесь я безуспешно пытаюсь поместить одно изображение справа от первого переключателя. Как мне поместить изображения справа от переключателей?

12
задан Paramjit Singh Rana 14 January 2019 в 09:52
поделиться