【发布时间】:2012-07-18 03:18:59
【问题描述】:
我正在尝试将图像添加到我的 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);
谢谢!
【问题讨论】:
-
专业提示:Alt+PrtScr 对当前窗口进行截图。或者,由于您使用的是 Windows 7,请使用截图工具。
标签: android android-layout android-listview