一个简单的测试失败了:创建一个只有一个子视图(UITextView)的新项目,并放入以下内容:
- (void)viewDidLoad
{
[super viewDidLoad];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineHeightMultiple = 50.f;
paragraphStyle.lineSpacing = 100.f;
paragraphStyle.minimumLineHeight = 200.f;
paragraphStyle.maximumLineHeight = 500.f;
UIFont *font = [UIFont fontWithName:@"AmericanTypewriter" size:24.f];
self.textView.attributedText = [[NSAttributedString alloc] initWithString:
@"This is a test.\n Will I pass?" attributes:
@{NSParagraphStyleAttributeName : paragraphStyle, NSFontAttributeName : font}];
}
行距与未使用属性时相同。有人成功地让它工作了吗?我放了一些荒谬的数字,只是为了表明它不会改变...