mskw
mskw

Reputation: 10358

How to set UILabel's text parameters

I saw a helpful answer regarding how to set UILabel's parameters, but the problem is that they are not anything that I'm used to. How would I enter these parameters pragmatically in to UILabel?

I know how to do some, but the other more advanced parameters are out of my league for the moment.

Plain
fontName: Helvetica-Bold
pointSize: 18.000000
textColor: UIDeviceWhiteColorSpace 1 1
shadowColor: UIDeviceWhiteColorSpace 0 0.44
shadowOffset: CGSize 0 1

Grouped

fontName: Helvetica-Bold
pointSize: 17.000000
textColor: UIDeviceRGBColorSpace 0.298039 0.337255 0.423529 1
shadowColor: UIDeviceWhiteColorSpace 1 1
shadowOffset: CGSize 0 1

Thanks

Upvotes: 1

Views: 2359

Answers (1)

Ismael
Ismael

Reputation: 3937

You mean this?

Plain:

label.font = [UIFont fontWithName:@"Helvetica-Bold" size:18.000000];
label.textColor = [UIColor colorWithWhite:1 alpha:1]; // or [UIColor whiteColor];
label.shadowColor = [UIColor colorWithWhite:0 alpha:0.44]; // or [[UIColor blackColor] colorWithAlphaComponent:0.44]
label.shadowOffset = CGSizeMake(0, 1);

Grouped:

label.font = [UIFont fontWithName:@"Helvetica-Bold" size:17.000000];
label.textColor = [UIColor colorWithRed:0.298039 green:0.337255 blue:0.423529 alpha:1];
label.shadowColor = [UIColor colorWithWhite:1 alpha:1]; // or [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0, 1);

Upvotes: 5

Related Questions