这是代码示例。我要结合图像和字符串数组。
Question t1 = new Question (question: "image",option1: "A",option2: "B")
这是代码示例。我要结合图像和字符串数组。
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>