Reputation: 8967
I have the following code for setting up text in a UIButton
[self.fullListButton_ setTitle:[NSString stringWithFormat:@"%d", [self.newsfeedItem_.newsfeedToSubjects count] - 3] forState:UIControlStateNormal];
The issue is I can't seem to set the font for this. How do I do so?
Upvotes: 17
Views: 24307
Reputation: 7065
In the newer version of iOS:
UIButton * myButton;
myButton.titleLabel.font = [UIFont systemFontOfSize: 12];
Or any other font mechanism.
Look here for the UIButton portions:
And here for the UIFont stuff:
In your code:
self.fullListButton_.titleLabel.font = [UIFont systemFontOfSize: 12];
or
self.fullListButton_.titleLabel.font = [UIFont fontWithName:@"Arial" size:12];
Upvotes: 35