我的列表视图为
<ListView
android:layout_below="@+id/tags_activity_list_empty_msg"
android:id="@+id/select_names_tags_lv"
android:background="@android:color/transparent"
android:fastScrollEnabled="true"
android:paddingLeft="0dip"
android:paddingTop="10.5dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fadeScrollbars="true"
android:cacheColorHint="#00000000"
android:layout_gravity="center_vertical"/>
当我运行我的应用程序列表时,项目显示的颜色与我在布局的背景颜色中使用的颜色相同。我尝试了1和2以及3,但找不到我的解决方案。我在getView方法中也使用了view.setBackgroundColor(android.R.color.transparent);
,但问题是一样的。应该是什么解决方案?
答案 0 :(得分:2)
view.setBackgroundColor(android.R.color.transparent);
应为view.setBackgroundResource(android.R.color.transparent)
因为setBackgroundColor将十六进制颜色值作为参数。