相关疑难解决方法(0)

归因于文本中心对齐

我已经尝试了一切但似乎无法将这个文本集中在一起.有人可以告诉我错误在哪里.

NSMutableParagraphStyle *paragraphStyle = NSMutableParagraphStyle.new;
paragraphStyle.alignment = NSTextAlignmentCenter;
label.attributedText = [[NSAttributedString alloc] initWithString:cell.EventTitle.text attributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],NSParagraphStyleAttributeName:paragraphStyle,NSBaselineOffsetAttributeName : @0,NSFontAttributeName : [UIFont fontWithName:@"BrandonGrotesque-Black" size:34]}];
Run Code Online (Sandbox Code Playgroud)

xcode label nsattributedstring centering ios

71
推荐指数
8
解决办法
6万
查看次数

标签 统计

centering ×1

ios ×1

label ×1

nsattributedstring ×1

xcode ×1