草庐IT

mutableAttributedTitle

全部标签

ios - 以编程方式更改 UIButton 的属性标题

我想以编程方式更改具有属性标题的UIButton的标题。该按钮是在IB中创建的。我不想只更改标题/文本的属性。我试过下面的代码,但找不到更改NSAttributedString标题的方法。NSAttributedString*attributedString=[self.deleteButtonattributedTitleForState:UIControlStateNormal];//HowcanIchangetitleofattributedStringwithoutchangingtheattributes?[self.deleteButtonsetAttributedTitl

ios - 以编程方式更改 UIButton 的属性标题

我想以编程方式更改具有属性标题的UIButton的标题。该按钮是在IB中创建的。我不想只更改标题/文本的属性。我试过下面的代码,但找不到更改NSAttributedString标题的方法。NSAttributedString*attributedString=[self.deleteButtonattributedTitleForState:UIControlStateNormal];//HowcanIchangetitleofattributedStringwithoutchangingtheattributes?[self.deleteButtonsetAttributedTitl