wxxsw / SwiftTheme

🎨 Powerful theme/skin manager for iOS 9+ 主题/换肤, 暗色模式
MIT License
2.52k stars 305 forks source link

oc 如何设置渐变 theme_colors #151

Closed bbtyou closed 3 years ago

bbtyou commented 3 years ago
image

_gradientLayer.theme_colors = [ThemeCGColorPicker pickerWithKeyPath:_theme_path map:^CGColorRef _Nullable(NSArray list) { NSMutableArray colors = @[].mutableCopy; for (NSString *hex in list) { [colors addObject:(id)HexColor(hex).CGColor]; } return [colors copy]; }];

pickerWithKeyPath返回的是CGColorRef,而不是数组,并且设置了[UIColor redColor].CGColor也没有生效。

NikhilGangurde commented 2 years ago

Did you find a solution if you did can you show it?

bbtyou commented 2 years ago

自己监听,重新设置下。

image