ListView に画像を追加して、ボタンのように見せようとしています。画像をもう少し小さくしたいと思います。おそらく現在の 60% です。そして、列の右側に画像がきれいに並びます。ここに私が現在持っているものの画面があります:
ここに私のリストビューxmlがあります:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp"
android:layout_width="match_parent"
android:drawableRight="@drawable/arrow_button"
>
</TextView>
私が間違って何をしているのか分かりますか?
この TextView を含む ListView は、次のように定義されます。
リストを作成して操作する方法は、次のようなコードを使用して ListAdapter を使用することに注意してください。
Question q = new Question ();
q.setQuestion( "This is a test question and there are more than one" );
questions.add(q);
adapter = new ArrayAdapter<Question>( this, R.layout.questions_list, questions);
setListAdapter(adapter);
ありがとう!