我正在尝试更改 Apple Research 套件的标签、图像等的默认颜色,但没有取得任何成功。
有配置吗?我需要在 AppDelegate.h 中更改它吗?您能否分享一个代码示例。
我不确定如何使用“appearanceWhenContainedInInstancesOfClasses”。
Set tint color at UIView
UIView.appearanceWhenContainedInInstancesOfClasses([ORKTaskViewController.self]).tintColor = UIColor().darkPurple
最佳答案
对用于调用任务的 View Controller 使用以下内容。色调颜色应相应改变。要更改配色方案,请在任务完成执行后调用它。您的 ORKConsentDocument 动画和其他任务现在将具有与您选择的颜色相同的色调。
UIView.appearance().tintColor = UIColor.blue
// Code to do present task
present(taskViewController, animated: true, completion: nil)
// in extension
func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskViewControllerFinishReason, error: Error?) {
//Handle results with taskViewController.result
taskViewController.dismiss(animated: true, completion: nil)
UIView.appearance().tintColor = UIColor.red
假设红色是您的默认颜色。
关于ios - 更改研究套件的 UILabel 颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46946176/