6
我有一個文本的橢圓路徑。對於填充路徑我使用NSMutableAttributedString:NSMutableAttributedString垂直對齊
UIFont *font = [UIFont fontWithName:@"font name" size:15];
NSMutableParagraphStyle *mutParaStyle=[[NSMutableParagraphStyle alloc] init];
[mutParaStyle setAlignment:NSTextAlignmentCenter];
[mutParaStyle setLineBreakMode:NSLineBreakByWordWrapping];
NSDictionary *attrsDictionary = [NSDictionary dictionaryWithObjectsAndKeys:font
,NSFontAttributeName,mutParaStyle ,NSParagraphStyleAttributeName,nil];
NSMutableAttributedString *strText = [[NSMutableAttributedString alloc] initWithString:text attributes:attrsDictionary];
但是,這項工作只適用於水平文本對齊。我如何應用垂直對齊?
我有這樣的結果:
但我需要這樣的:
我已經更新了這個問題,現在可能會更清楚 –