这是代码的示例。我想要组合图像和字符串数组。
Question t1 = new Question (question: "image", option1: "A", option2: "B")
你可以试试这个
var data = mutableListOf<Any>()
data.add("your image")
data.add("your string")
data.add("or any your type data")
最简单的是在垂直LinearLayout中组合ImageView和RadioButton的自定义视图。
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<ImageView
android:src="imageSrc"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RadioButton
android:text="A"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<RadioButton
android:text="B"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RadioGroup>
</LinearLayout>