如何更改android.R.id.text1的textColor?
我想更改listview项的颜色,但我不知道如何访问android.R.id.text1如何更改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"
如果有人知道如何更改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" />
您可以根据需要设置填充。供您参考这是不可能的。相反,您可以使用自己的文本视图