1
我正在嘗試爲複雜模板圖像添加色調顏色。當我滾動選項來自定義我的錶盤時,色調是正確的。但是,一旦我選擇複雜功能並返回正常錶盤狀態,顏色將切換回白色。Apple Watch Complication Tint Color
- (void)getLocalizableSampleTemplateForComplication:(CLKComplication *)complication withHandler:(void(^)(CLKComplicationTemplate * __nullable complicationTemplate))handler {
CLKComplicationTemplateModularSmallSimpleImage *modularTemplate = [[CLKComplicationTemplateModularSmallSimpleImage alloc] init];
CLKImageProvider *imageProvider = [CLKImageProvider imageProviderWithOnePieceImage:[UIImage imageNamed:@"Complication/Modular"]];
imageProvider.tintColor = [UIColor colorWithRed:0.412 green:0.443 blue:0.773 alpha:1.000];
modularTemplate.imageProvider = imageProvider;
handler(modularTemplate);
}
定製: Tint is correct while customizing
併發症後選擇: Tint is gone and it's back to a white image
在你的問題的功能只選擇一種併發症時所顯示的__template__的照顧。您需要在準備實際複雜數據的函數中複製相同的行爲。 –
@DávidPásztor謝謝。這就是訣竅! – dyah