我想添加一个图像到我的ListView,使它看起来更像一个按钮。我希望图像稍微小一点,大概是目前的60%。图像在列的右侧很好地排列。这里是什么,我现在有一个画面:Android - 如何对齐列表视图项目以良好的间距左右对齐?
,这里是我的列表视图中的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);
谢谢!
Protip:Alt + PrtScr截取当前窗口的截图。或者因为您在Windows 7上,请使用“截取工具”。 – kcoppock 2012-07-18 03:46:25