多肢選択問題を含むアプリケーションを 1 つ作成したいと考えています。各質問には 3 つの選択肢があります。そのオプションを 1 つの背景画像で示したいと思います。また、質問ごとにその画像の色をランダムに変更したいと考えています。どうやってやるの?
行ごとに異なる背景画像を配置してリスト ビューを作成することはできますか?
結果.xml
<LinearLayout
android:id="@+id/linearlayoutans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:layout_toLeftOf="@+id/chrono"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_ans_true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/ic_launcher"
android:gravity="center"
android:textColor="#000000" />
<TextView
android:id="@+id/txt_ans_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/ic_launcher"
android:gravity="center"
android:textColor="#000000" />
<TextView
android:id="@+id/txt_ans_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/ic_launcher"
android:gravity="center"
android:textColor="#000000" />
</LinearLayout>