2011-10-30 46 views
1

對於標籤或按鈕標題,當我使用Helvetica字體,它看起來像這樣: iOS的日文字符居中問題

但是當我使用HiraKakuProN-W6(Hiragino賀來哥特PRON W6)字體(日本字符)它給了我這個:enter image description here

我想知道這是否是正常行爲。如果是的話,我會感謝任何能告訴我如何集中日文字體的人。 在此先感謝!

回答

0

是的,這是一個問題。我建議你使用系統字體。

+0

終於做到了! – Prathiba

0

我遇到一模一樣的問題,並找到一種方法來解決它的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

+0

將檢查它,讓你知道:) – Prathiba