4

UILabel のややあいまいな問題について、助けが得られることを願っています。文字のクリッピングで問題が発生し続けます。以下のリンクの画像のフォントは、baskerville-bolditalic です。黄色は、UIButton がレンダリングされる rect です。黄色は、UIButton の titleLabel.backgroundColor です。

http://img5.imageshack.us/img5/2381/screenshot20100813at235.png

コードは次のとおりです。

    UIButton * currentCharacter = [UIButton buttonWithType:UIButtonTypeCustom];
    currentCharacter.frame = cFrame;
    currentCharacter.backgroundColor = [UIColor blueColor];
        currentCharacter.titleLabel.backgroundColor = [UIColor yellowColor];
        currentCharacter.titleLabel.numberOfLines = 1;
        currentCharacter.titleLabel.adjustsFontSizeToFitWidth = YES;
        currentCharacter.titleLabel.minimumFontSize = 1;
        currentCharacter.titleLabel.font = currentFont;
        currentCharacter.titleLabel.clipsToBounds = NO;
        currentCharacter.clipsToBounds = NO;

        currentCharacter.titleLabel.textAlignment = UITextAlignmentCenter;
        currentCharacter.titleLabel.adjustsFontSizeToFitWidth = YES;

多分私はちょうどadjustsFontSizeToFitWidthを誤解しています。事前にたくさんありがとう!

4

0 に答える 0