如何在ios中加粗按钮文字?

vin*_*thp 4 iphone fonts ios ios5

在我的应用程序中,我使用自定义字体,工作得很好.但我需要按钮文字为粗体.我用谷歌搜索它只有系统字体.

button.titleLabel.font = [UIFont fontWithName:@"YanaR" size:20.0]; 
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

Rin*_*cha 10

在fontWithName之后你必须使用boldSystemFontOfSize:

[button.titleLabel setFont:[UIFont fontWithName:@"Arial" size:13.f]];
[button.titleLabel setFont:[UIFont boldSystemFontOfSize:13.f]];
Run Code Online (Sandbox Code Playgroud)