Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 更改列表视图的背景色_Android - Fatal编程技术网

Android 更改列表视图的背景色

Android 更改列表视图的背景色,android,Android,有人能帮我更改列表视图的背景色吗?。我是android新手,我真的需要知道这一点。任何帮助都将不胜感激 谢谢 这是否有帮助,例如: <ListView android:id="@+id/rssListView" android:background="#7700CC00" android:layout_height="wrap_content" android:layout_width="match_parent" /> ?例如: <ListVie

有人能帮我更改列表视图的背景色吗?。我是android新手,我真的需要知道这一点。任何帮助都将不胜感激


谢谢

这是否有帮助,例如:

<ListView android:id="@+id/rssListView"
    android:background="#7700CC00"
    android:layout_height="wrap_content"
    android:layout_width="match_parent" />


例如:

<ListView android:id="@+id/rssListView"
    android:background="#7700CC00"
    android:layout_height="wrap_content"
    android:layout_width="match_parent" />


您可以使用ListView的setBackgroundColor()方法。

您可以使用ListView的setBackgroundColor()方法。

实际上,我已经在Java Android中创建了一个列表。我想通过Java代码更改背景颜色。实际上,我已经在Java Android中创建了一个列表。我想通过Java代码更改背景颜色。请进行编辑,使文本不全部位于代码块中。请进行编辑,使文本不全部位于代码块中。但此方法有一个int参数。颜色编号从#开始。它给出了一个错误。在代码中,颜色值也可以用十六进制格式给出,但只需将#替换为0x即可。您还可以使用color类设置颜色:setBackgroundColor(color.BLACK);但是这个方法有一个int参数。颜色编号从#开始。它给出了一个错误。在代码中,颜色值也可以用十六进制格式给出,但只需将#替换为0x即可。您还可以使用color类设置颜色:setBackgroundColor(color.BLACK);或者别的什么。