【发布时间】:2015-01-19 12:30:32
【问题描述】:
我试图证明我的 UILabel 文本是正确的,但它不起作用。
声明我的UIView:
descriptionUIView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)
声明我的UILabel:
bottleDescriptionLabel = UILabel(frame: CGRect(x: widthMargin, y: bottleDescriptionTitleLabel.frame.maxY + heightMargin, width: self.view.frame.width - (2 * widthMargin), height: heightBottleDescription - (2 * heightMargin)))
bottleDescriptionLabel.font = UIFont(name: "AvenirNext-Regular", size: 16)
bottleDescriptionLabel.text = bottleDescriptionString
bottleDescriptionLabel.lineBreakMode = NSLineBreakMode.ByWordWrapping
bottleDescriptionLabel.textAlignment = NSTextAlignment.Justified
bottleDescriptionLabel.numberOfLines = 0
它看起来像这样:
我不知道还有什么可以使用NSTextAlignment.Justified 来证明我的文字的合理性。我应该改用UITextView 吗?
【问题讨论】:
标签: swift uilabel text-alignment justify