infoLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,150, 200, 30)];
[infoLabel setText:@"Drag 14 more Flavors"];
[infoLabel setBackgroundColor:[UIColor clearColor]];
[infoLabel setFont:[UIFont fontWithName:@"Arial" size:17]];
[infoLabel setTextColor:[UIColor开发者_JAVA技巧 colorWithRed:1.0 green:0 blue:0 alpha:1 ]];
I used above label to get red color but client says i need more dark color ,please help
IB has color picker where you can choose whatever color you like, then switch to "Color sliders" mode to see its actual rgb components values and then put them in your code. For example you can just play with red component:
// This looks darker
[infoLabel setTextColor:[UIColor colorWithRed:0.5 green:0 blue:0 alpha:1 ]];
Or you can look into tables for commonly used colors (e.g. here or here). Firebrick color (from the 1st link) may suit your purpose:
[infoLabel setTextColor:[UIColor colorWithRed:178.0/255 green:34.0/255 blue:34.0/255 alpha:1 ]];
精彩评论