xon*_*rlz 17 iphone objective-c ipad ios
我有以下代码用于在UIButton中设置文本
[self.fullListButton_ setTitle:[NSString stringWithFormat:@"%d", [self.newsfeedItem_.newsfeedToSubjects count] - 3] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
问题是我似乎无法为此设置字体.我该怎么办?
tru*_*cks 35
在较新版本的iOS中:
UIButton * myButton;
myButton.titleLabel.font = [UIFont systemFontOfSize: 12];
Run Code Online (Sandbox Code Playgroud)
或任何其他字体机制.
在这里查看UIButton部分:
这里是UIFont的东西:
在你的代码中:
self.fullListButton_.titleLabel.font = [UIFont systemFontOfSize: 12];
Run Code Online (Sandbox Code Playgroud)
要么
self.fullListButton_.titleLabel.font = [UIFont fontWithName:@"Arial" size:12];
Run Code Online (Sandbox Code Playgroud)