【发布时间】:2014-11-07 10:33:54
【问题描述】:
我想以编程方式更改具有属性标题的UIButton 的标题。
该按钮是在 IB 中创建的。我不想只更改标题/文本的属性。
我尝试了下面的代码,但找不到更改 NSAttributedString 标题的方法。
NSAttributedString *attributedString = [self.deleteButton attributedTitleForState:UIControlStateNormal];
// How can I change title of attributedString without changing the attributes?
[self.deleteButton setAttributedTitle:attributedString forState:UIControlStateNormal];
谢谢!
【问题讨论】: