If I create a button in IB, and set only the type to be Custom, the Title and font size, it comes out nice and clear. If I create it programmatically, then the font comes out fuzzy. The code to create the button is:
CGRect frame = self.sendButton.frame;
NSString *title = @"Read Disclosure";
UIFont *font = [UIFont boldSystemFontOfSize:17.0];
CGSize titleSize = [title sizeWithFont:font constrainedToSize:frame.size];
CGFloat xValue = (self.view.frame.size.width - titleSize.width) / 2;
CGFloat yValue = frame.origin.y - (titleSize.height / 2);
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setFrame:CGRectMake(xValue, yValue, titleSize.width, titleSize.height * 2)];
[button setTitle:@"Read Disclosure" forState:UIControlStateNormal];
[button.titleLabel setFont:font];
[button setTitleColor:[UIColor colorWithRed:50.0/255.0 green:79.0/255.0 blue:133.0/255.0 alpha:1.0] forState:UIControlStateNormal];
[button setTitleShadowColor:nil forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[button addTarget:self action:@selector(disclosureButtonAction) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];
I've tried every setting I can think of, and nothing seems to make a difference. Any idea of what I'm missing here?
Thanks.