lixiang1994 / LEETheme

优雅的主题管理库- 一行代码完成多样式切换
MIT License
818 stars 135 forks source link

颜色在json里面怎么办,demo是直接写的颜色 #15

Closed Laughing1206 closed 5 years ago

Laughing1206 commented 6 years ago
    tabBarItem.lee_theme
    .LeeAddSelectorAndValues(DAY , @selector(setTitleTextAttributes:forState:) , @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:LEEColorRGB(33, 151, 216)} , @(UIControlStateSelected) , nil)
    .LeeAddSelectorAndValues(NIGHT , @selector(setTitleTextAttributes:forState:) , @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:LEEColorRGB(28, 125, 178)} , @(UIControlStateSelected) , nil)
    .LeeAddSelectorAndValues(DAY , @selector(setTitleTextAttributes:forState:) , @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:LEEColorRGB(159, 159, 159)} , @(UIControlStateNormal) , nil)
    .LeeAddSelectorAndValues(NIGHT , @selector(setTitleTextAttributes:forState:) , @{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:LEEColorRGB(230, 230, 230)} , @(UIControlStateNormal) , nil);
lixiang1994 commented 6 years ago

JSON的配置 要利用Identifier方式设置 例如:

.LeeCustomConfig(@"ident5", ^(UIView *item, id value) {

        item.alpha = [value floatValue];
    });