【问题标题】:Set ListView Item Text Color to Black - Android C# Xamarin [duplicate]将 ListView 项目文本颜色设置为黑色 - Android C# Xamarin [重复]
【发布时间】:2017-05-25 04:35:56
【问题描述】:

我正在尝试设置我的 ListView 的样式,以便 Item Text Color 是黑色的。 我尝试输入android:textColor="#000000",但仍然无法正常工作。 背景是我想要的白色。

如何通过 XML 或以编程方式将 ListView 项目文本颜色设为黑色?

【问题讨论】:

  • 除了 AXML 之外,我没有任何代码,其中没有关于 textColor

标签: c# android listview xamarin textcolor


【解决方案1】:

在您的自定义适配器中尝试此代码。

TextView text = new TextView(context);
text.setTextColor(Color.parseColor("any hex value of a color"));

【讨论】:

    猜你喜欢
    • 2016-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-19
    • 1970-01-01
    • 2011-10-16
    • 2015-11-05
    • 1970-01-01
    相关资源
    最近更新 更多