【发布时间】:2017-01-11 08:04:27
【问题描述】:
团队,
我在 UITextView 中添加了文本内容,字体系列为 avinar roma,我注意到每个单词之间的差距很小,不一致。如何避免 textview 文本中每个单词的小间隙。
descriptionTextView = [[UITextView alloc] initWithFrame:CGRectMake(20, titlelabel.frame.origin.y + titlelabel.frame.size.height + 5, view.frame.size.width - 40, view.frame.size.height - 150)];
descriptionTextView.backgroundColor = [UIColor clearColor];
descriptionTextView.textColor = MH_PANTONE_444;
descriptionTextView.textAlignment = NSTextAlignmentCenter;
descriptionTextView.font = [UIFont fontWithName:MH_FONT_AVENIRROMAN size:MH_SCREEN_HEIGHT/48];
descriptionTextView.text = [descriptionArray objectAtIndex:index];
descriptionTextView.editable = NO;
descriptionTextView.scrollEnabled = NO;
descriptionTextView.selectable = YES;
descriptionTextView.dataDetectorTypes = UIDataDetectorTypeAll;
请在上面附上图片 大学医学中心,与剩余文字的差距不一样。
【问题讨论】:
-
请提供屏幕截图。
-
文本看起来更“合理”而不是“居中”
-
@d.felber 在“对齐”或“居中”这两种情况下,它将给另一个文本留出空白。如何避免 UITextView 文本中的空白。
-
@d.felber 在我的情况下,我需要使用 Justified 进行 NSAlignment。
-
标签: ios objective-c fonts uitextview