我有以下代码用于在 UIButton 中设置文本
[self.fullListButton_ setTitle:[NSString stringWithFormat:@"%d", [self.newsfeedItem_.newsfeedToSubjects count] - 3] forState:UIControlStateNormal];
问题是我似乎无法为此设置字体。我该怎么做?
我有以下代码用于在 UIButton 中设置文本
[self.fullListButton_ setTitle:[NSString stringWithFormat:@"%d", [self.newsfeedItem_.newsfeedToSubjects count] - 3] forState:UIControlStateNormal];
问题是我似乎无法为此设置字体。我该怎么做?
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];