NSAttributedStringを使用してテキストのフォントサイズを変更しようとしています。サイズは変わりません。目的c UIFont systemFontOfSizeが機能しない
NSDictionary *attrDict = @{NSFontAttributeName : [UIFont boldSystemFontOfSize:22], NSForegroundColorAttributeName : [UIColor orangeColor]};
NSAttributedString *newAttString = [[NSAttributedString alloc] initWithString:mytext attributes:attrDict];
[result appendAttributedString:newAttString];
テキストの色のみが変更されます。結果の文字列のサイズは22ではなく、太字でもありません。代わりのallocと属性を適用する
ログに 'newAttString'の値が正しいようですか? 'newString'も追加した後の' result'の1つですか?あなたの問題はその後になる可能性があります。 – Larme
文字列が正しい。エラーはありません。しかし、フォントサイズは変わりません。 – user
後で 'result'をどうしますか?どこかで 'NSFontAttributeName'をもう一度適用しますか? – Larme