- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我无法为 body1TextProvider 和 body2TextProvider 设置白色文本颜色。只有灰色可供选择。
我的代码:
let modularLarge = CLKComplicationTemplateModularLargeStandardBody()
modularLarge.headerTextProvider = CLKSimpleTextProvider(text: dateText.capitalized)
modularLarge.headerTextProvider.tintColor = self.tintColor
modularLarge.body1TextProvider = CLKSimpleTextProvider(text: timeText)
modularLarge.body2TextProvider = CLKSimpleTextProvider(text: "00:00")
modularLarge.body1TextProvider.tintColor = self.whiteColor
modularLarge.body2TextProvider?.tintColor = self.whiteColor
handler(CLKComplicationTimelineEntry(date: Date(),complicationTemplate: modularLarge))
最佳答案
在我看来,在 CLKSimpleTextProvider
上应用 tintColor
似乎存在错误或一些未记录的细微差别。
根据关于CLKSimpleTextProvider
的tintColor
的文档:
tintColor
The tint color to use for text.
Discussion
On clock faces that support custom colors, this color is applied to the text in your text provider.
Ref: https://developer.apple.com/documentation/clockkit/clktextprovider/1627929-tintcolor
现在...在选择多色模块化表盘后,我们可以观察到 headerTextProvider.tintColor
像文档中描述的那样工作,并且确实应用了指定的 UIColor
。< br/>但是……body1TextProvider.tintColor
和 body2TextProvider?.tintColor
不能像文档中那样工作,因为它不应用给定的 UIColor
。
向我们展示记录的行为并未在所有 textProvider
中统一应用。
我注意到,如果您将 CLKComplicationTemplate
的 tintColor
设置为某个值,则 body1TextProvider
和 body2TextProvider
将变为白色,即使您尝试设置其他颜色,如蓝色/黄色等。
幸运的是,您希望它是白色的,所以简单地 modularLarge.tintColor = .red
(或匹配您的主题的 UIColor
)将为您提供白色正文。
无需执行以下操作(删除/保留,无所谓):
modularLarge.body1TextProvider.tintColor = self.whiteColor
modularLarge.body2TextProvider?.tintColor = self.whiteColor
相反,在调用 handler
之前执行此操作:
modularLarge.tintColor = UIColor.red
let modularLarge = CLKComplicationTemplateModularLargeStandardBody()
modularLarge.tintColor = .red //do this
modularLarge.headerTextProvider = CLKSimpleTextProvider(text: dateText.capitalized)
modularLarge.headerTextProvider.tintColor = self.tintColor
modularLarge.body1TextProvider = CLKSimpleTextProvider(text: timeText)
modularLarge.body2TextProvider = CLKSimpleTextProvider(text: "00:00")
handler(CLKComplicationTimelineEntry(date: Date(),complicationTemplate: modularLarge))
关于swift - 如何在 Modular Large Complication 中设置白色文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54780956/
我具有以下Xcode项目依赖项: A -> C B -> C 当我分别构建它们时,一切正常。 但是,我想将A和B添加到同一Xcode项目中,从而创建以下依赖关系图: / -> A -> C D
“模块化”的有效性取决于将系统划分为模块时使用的标准。 我想要的是,提出一些可用于将系统分解为模块的标准。 最佳答案 Cohesion : 模块中的功能是相关的。 Low coupling :模块之间
加载+重新加载 fsx 文件的推荐方法是什么?只是试验......是的,是的,正确的语言,正确的工作等等。 我喜欢如何在 FSI 中完成以下工作: #load "script.fsx"; open S
在 igraph ?modularity 部分给出了示例代码 g <- graph.full(5) %du% graph.full(5) %du% graph.full(5) g <- add.edg
最近我对如何组织我的 Scala 代码感到困惑,因为有很多选择。 Scala 如何/何时使用包、对象、包对象来组织代码是否有任何指导方针? 最佳答案 了解 Scala 的功能 首先,我们需要了解每种模
我的 node.js 应用程序中有这样的文件结构: 应用程序 模特 用户 书 Controller 用户 书 观看次数 用户 书 我想让我的应用模块化。如何从 user Controller 与 bo
因为我需要测试 Boost 的一些实验性功能,所以我想从 Modular Boost 存储库安装 Boost。 我按照 https://svn.boost.org/trac/boost/wiki/Tr
我用了flutter_modular用于 flutter web 导航。 import 'package:flutter_modular/flutter_modular.dart'; class A
我需要计算 (a/b) mod m 哪里 a 和 b 是非常大的数字。 我想做的是计算 (a mod m) * (x mod m) ,其中 x 是 modular inverse的 b . 我尝试使用
我想构建一个可以在单个页面上有多个实例的 jQuery 应用程序。 但是,我遇到了一个实例从其他实例接收事件的问题。例如,如果我有以下事件: $('#start_btn').click(...) 如果
我是 java 和 javafx 2 的新手。我想要做的是一个应用程序,它基本上是一个容器,用于放置以后可以添加的单独“模块”。 主要应用程序应该是某种内容浏览器,用于扫描文件夹中的模块。然后,您可以
我一直在考虑创建一个程序,该程序可以执行多个不同的任务,同时由一个中央线程监视。这个想法是创建一个核心程序,该程序将在运行时/运行时查找并加载单独的模块。这些模块将在将完成的对象传递给另一个模块之前执
目前正在创建一个代码,使用两种类型的优先级队列作为单独的方法,方法之间的代码相似,试图将它们模块化为一个方法,但优先级队列类型的参数不同 我当前正在运行 eclipse,尝试添加 if 语句(如果 1
今天我无法将 apply 函数应用到 modularity 函数,后者的函数在 'igraph' 包中。以下是代码和结果" > library(igraph) > g = graph.full(2)
目标:创建一个模块化应用程序,其上的插件必须具有 UI(这是关键点)。我有关于主应用程序(“服务器”)的所有信息,也有关于所有插件的信息(所有这些都将由我们制作)。所以我们想把主 apk 给用户,让他
我无法为 body1TextProvider 和 body2TextProvider 设置白色文本颜色。只有灰色可供选择。 我的代码: let modularLarge = CLKComplicati
我想使用 Rails 构建一个可扩展的模块化应用程序,该应用程序可以配置以满足个人需求。 让我解释一下我对“可扩展”和“模块化”的理解。例如,假设我正在开发一个博客应用程序引擎并且我有一个名为 Blo
我是一名在大学工程项目团队工作的学生。 我们的软件子团队正在寻求创建一个模块化的 GUI,允许通过捕捉面板进行实时重新配置,用户可以在 GUI 周围移动和分离(具有此类 GUI 的流行程序:Adobe
如果我用 emcc 编译我的 C++ 代码没有 -s MODULARIZE=1 -s 'EXPORT_NAME="createMyModule"' ,我可以加载我的 WebAssembly 并访问 F
基于此结构:http://flask.pocoo.org/docs/patterns/packages/ 我也尝试过这篇文章:Deploying Flask app to Heroku 我无法让它在
我是一名优秀的程序员,十分优秀!