【问题标题】:My list view displaying darker color of background color我的列表视图显示较深的背景颜色
【发布时间】:2011-04-07 08:07:12
【问题描述】:

我的列表视图为

<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"/>

当我运行我的应用程序时,列表项显示的颜色与我在布局的背景颜色中使用的颜色相同。我试过123 但找不到我的解决方案。我还在 getView 方法中使用了view.setBackgroundColor(android.R.color.transparent);,但问题是一样的。应该有什么解决办法?

【问题讨论】:

    标签: android listview android-layout


    【解决方案1】:

    view.setBackgroundColor(android.R.color.transparent); 应该是 view.setBackgroundResource(android.R.color.transparent) 因为 setBackgroundColor 将十六进制颜色值作为参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-15
      • 2014-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多