xamarin android 在代码中如何设置文本颜色

时间:2023-03-09 04:36:29
xamarin android 在代码中如何设置文本颜色

xamarin android 在代码中如何设置文本颜色

  TextView v = FindViewById<TextView>(Android.Resource.Id.Message);
  v.SetTextColor(Android.Content.Res.ColorStateList.ValueOf(Android.Graphics.Color.Blue));

非常明显这个SetTextColor用的java中的方法,里面的颜色也只能用android Graphics 对象中的值,这就有点尴尬的,Graphics中的值实在有限,我要用自己写的颜色代码值那该如何设置呢?