Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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.R.id.text1的textColor?_Android - Fatal编程技术网

如何更改android.R.id.text1的textColor?

如何更改android.R.id.text1的textColor?,android,Android,我想更改listview项的颜色,但我不知道如何访问android.R.id.text1 如果有人知道如何更改android.R.id.text1的颜色,请帮助我。请参考下面的链接 其中,CustomAdapter类中有一个名为“getView”的方法 用这种方法,你可以改变颜色。 或 您还可以从xml文件更改,如下所示: android:textColor="yourcolor" 使用以下自定义XML进行尝试 <TextView android:id="@+id/tvName"

我想更改listview项的颜色,但我不知道如何访问android.R.id.text1


如果有人知道如何更改android.R.id.text1的颜色,请帮助我。

请参考下面的链接

其中,CustomAdapter类中有一个名为“getView”的方法

用这种方法,你可以改变颜色。

您还可以从xml文件更改,如下所示:

android:textColor="yourcolor"

使用以下自定义XML进行尝试

<TextView android:id="@+id/tvName"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:padding="5dp"
              android:textColor="your_color"
              android:text="Your_text" />


您可以根据需要设置填充。供您参考

这是不可能的。相反,您可以使用自己的文本视图