【发布时间】:2016-10-12 13:20:13
【问题描述】:
我能够以编程方式更改字符间距、标题颜色和字体样式。这是示例代码
let titleLabel = UILabel()
let colour = UIColor.redColor()
let attributes: [NSString : AnyObject] = [NSFontAttributeName: UIFont.systemFontOfSize(12), NSForegroundColorAttributeName: colour, NSKernAttributeName : 5.0]
titleLabel.attributedText = NSAttributedString(string: "My String", attributes: attributes)
titleLabel.sizeToFit()
self.navigationItem.titleView = titleLabel
但我想从情节提要中更改这三个。有什么办法吗?
【问题讨论】:
标签: ios cocoa-touch storyboard uistoryboard