對於標籤或按鈕標題,當我使用Helvetica字體,它看起來像這樣: iOS的日文字符居中問題
但是當我使用HiraKakuProN-W6(Hiragino賀來哥特PRON W6)字體(日本字符)它給了我這個:
我想知道這是否是正常行爲。如果是的話,我會感謝任何能告訴我如何集中日文字體的人。 在此先感謝!
對於標籤或按鈕標題,當我使用Helvetica字體,它看起來像這樣: iOS的日文字符居中問題
但是當我使用HiraKakuProN-W6(Hiragino賀來哥特PRON W6)字體(日本字符)它給了我這個:
我想知道這是否是正常行爲。如果是的話,我會感謝任何能告訴我如何集中日文字體的人。 在此先感謝!
是的,這是一個問題。我建議你使用系統字體。
我遇到一模一樣的問題,並找到一種方法來解決它的iOS 6:
label.attributedText = [[NSAttributedString alloc] initWithString:@"Start" attributes:@{
NSFontAttributeName : [UIFont fontWithName:@"HiraKakuProN-W6" size:16],
NSForegroundColorAttributeName : [UIColor blackColor],
}];
附:對於UIButton的titleLabel,將NSAttributedText
設置爲button.titleLabel
將不起作用,有一種方法- (void)setAttributedTitle:(NSAttributedString *)title forState:(UIControlState)state NS_AVAILABLE_IOS(6_0);
可用於UIButton
。
將檢查它,讓你知道:) – Prathiba
終於做到了! – Prathiba