Ova*_*han 6 android xamarin.android xamarin
我正在尝试为出现在通知顶部的应用程序名称文本设置颜色。如何将颜色从灰色变为绿色或蓝色?
只需设置通知的颜色(如/sf/answers/3211238551/ 中所述):
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
...
builder.setColor(ContextCompat.getColor(context, R.color.my_notif_color));
manager.notify(notificationId, builder.build())
Run Code Online (Sandbox Code Playgroud)
Sun*_*nny -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);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3409 次 |
最近记录: |