目前我可以通过故事板调整字体类型和大小。但是,我想为不同的场景设置WKInterfaceButton字体。

最佳答案

您可以通过NSAttributedString

UIFont * buttonFont = [UIFont fontWithName:@"Courier-Bold" size:6];
NSAttributedString *buttonText = [[NSAttributedString alloc] initWithString : @"Your button title" attributes : @{ NSKernAttributeName : @2.0, NSFontAttributeName : buttonFont}];
[self.button setAttributedTitle:buttonText];

关于objective-c - 如何以编程方式设置WKInterfaceButton字体?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29272904/

10-09 15:54