c# - 如何简化 Xamarin Forms 中字体和背景颜色的设置?
问题描述
目前我正在这样做:
1)用颜色设置样式:
public class Styles
{
public static Color[] LineColor = { greyF2, grey28, grey28 };
2)我的应用程序的样式值为 1,2 或 2,颜色设置如下:
Current.Resources["ShellBackgroundColor"] = Styles.ShellBackgroundColor[thc];
有没有办法可以简化上面这两行的编码?
解决方案
推荐阅读
- java - Hazelcast缓存实现使用Apache骆驼蓝图
- angular - 角度4:选项标签的多个值
- sql - 如何在 Postgres 中将 SQL 数据从一个视图转换为另一个视图
- rest - Meteor POST 不发送数据
- spring-boot - SpringBoot 命名查询:IN 子句不适用于多个值
- javascript - 单击按钮以创建 SELECT 和 OPTION 元素
- java - 将 CFCObject.class 作为参数从 Coldfusion 传递给 java 方法
- javascript - 如何根据之前的值更新 MongoDB 文档?
- c# - SQL 地理空间链接服务器查询
- java - Springboot 中有没有办法在不使用属性文件的情况下使用动态数据进行国际化