How to change an UILabel/UIFont's letter spacing?

Posted by Andre on Stack Overflow See other posts from Stack Overflow or by Andre
Published on 2010-03-30T12:02:26Z Indexed on 2010/03/30 12:03 UTC
Read the original article Hit count: 964

Filed under:
|
|
|
|

Hi,

I've searched loads already and couldn't find an answer.

I have a normal UILabel, defined this way:

    UILabel *totalColors = [[[UILabel alloc] initWithFrame:CGRectMake(5, 7, 120, 69)] autorelease];
    totalColors.text = [NSString stringWithFormat:@"%d", total];
    totalColors.font = [UIFont fontWithName:@"Arial-BoldMT" size:60];
    totalColors.textColor = [UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1.0];
    totalColors.backgroundColor = [UIColor clearColor];
    [self addSubview:totalColors];

And I wanted the horizontal spacing between letters, to be tighter, whilst mantaining the font size.

Is there a way to do this? It should be a pretty basic thing to do.

Cheers guys, Andre

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode