开发者

I need very dark color for my UILabel whose background is clear

开发者 https://www.devze.com 2023-02-02 06:30 出处:网络
infoLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,150, 200, 30)]; [infoLabel setText:@\"Drag 14 more Flavors\"];
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 ]];
0

精彩评论

暂无评论...
验证码 换一张
取 消