CLKComplication tintColor not working

I am trying to change the color of the text when I add the viewer application (modular large tall body), but whatever I do, the text remains white.

Here is my code, the lines that include tintColor, I tried them together and each one of them one by one.

let secondTemplate = CLKComplicationTemplateModularLargeTallBody()
secondTemplate.tintColor = UIColor.greenColor()
secondTemplate.headerTextProvider.tintColor = UIColor.greenColor()
secondTemplate.bodyTextProvider.tintColor = UIColor.greenColor()
secondTemplate.headerTextProvider = CLKSimpleTextProvider(text: location.uppercaseString)
secondTemplate.bodyTextProvider = CLKSimpleTextProvider(text: "It 4:20")
let secondEntry = CLKComplicationTimelineEntry(date: dateOf420, complicationTemplate: secondTemplate)
entries.append(secondEntry)

I was looking for CLKComplication tinted questions, but I didn’t find anything, hope you can help!

+4
source share
3 answers

The colors of the shades for complications are currently used in only two places:

  • The modular face when it is set to multicolor
  • Utility

Elsewhere, complication will use the color of the shades of the faces.

+4

, ... " " , :

enter image description here

, , . :

let headerTextProvider = CLKSimpleTextProvider(text: data.headerText)
headerTextProvider.tintColor = UIColor.yellowColor() // data.headerColor

let textProvider = CLKTimeTextProvider(date: data.date)

let template: CLKComplicationTemplate

switch family {

...

case .ModularLarge:
    let textTemplate = CLKComplicationTemplateModularLargeTallBody()
    textTemplate.headerTextProvider = headerTextProvider
    textTemplate.bodyTextProvider = textProvider
    template = textTemplate

}

template.tintColor = UIColor(red: 0.99, green: 0.99, blue: 0.99, alpha: 1)
return template

... , , . , , ,... , , .

+8

, public watchOS2.

  • . .

  • , , . , ModularLargeTallBody ModularLargeStandardBody . .

  • , tintColor , ( Apple), , .

, Apple .

+7

Source: https://habr.com/ru/post/1611194/


All Articles