我想以编程方式更改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];
Run Code Online (Sandbox Code Playgroud)
谢谢!