在通知中设置应用名称文字的颜色(Android)

时间:2017-10-08 14:55:03

标签: android xamarin xamarin.android

我正在尝试为通知顶部显示的应用名称文字设置颜色。如何将颜色从灰色更改为绿色或蓝色?

I am looking for something like below, for whatsapp it is green but for my app it is grey

2 个答案:

答案 0 :(得分:2)

只需设置通知的颜色(如https://stackoverflow.com/a/45874836/364388中所述):

InputStream

答案 1 :(得分:1)

通过它查找TextView并使用 SetTextColor 方法设置颜色。恩。如下。

var builder = new AlertDialog.Builder (this);
var dialog = builder.Show();
int textColorId = Resources.GetIdentifier ("alertTitle", "id", "android");
TextView textColor = dialog.FindViewById<TextView> (textColorId);
textColor?.SetTextColor (Color.DarkRed);