[self performSelector:@selector(afterClick:) withObject:[UIColor redColor]];
-(void)afterClick:(UIColor *)viewColor{
lblColor.backgroundColor=viewColor;
}
我想传递字符串而不是UIColor,请建议
答案 0 :(得分:0)
#define UICOLOR_FROM_HEX(hex, alpha) [UIColor colorWithRed: ((float)((hex & 0xFF0000) >> 16))/255.0 green: ((float)((hex & 0xFF00) >> 8))/255.0 blue: ((float)(hex & 0xFF))/255.0 alpha: alpha]
使用:
self.backgroundColor = UICOLOR_FROM_HEX(0xFFEECC, 1.0);