首页 > 解决方案 > 如何简化 Xamarin Forms 中字体和背景颜色的设置?

问题描述

目前我正在这样做:

1)用颜色设置样式:

public class Styles
{
    public static Color[] LineColor = { greyF2, grey28, grey28 };

2)我的应用程序的样式值为 1,2 或 2,颜色设置如下:

Current.Resources["ShellBackgroundColor"]   = Styles.ShellBackgroundColor[thc];

有没有办法可以简化上面这两行的编码?

标签: c#xamarinxamarin.forms

解决方案


推荐阅读