我在IB中创建了一个UIButton
,正在使用NSAttributedString.
设置标题
NSMutableAttributedString *att = [[NSMutableAttributedString alloc] initWithString:@"skip" attributes:@{NSForegroundColorAttributeName: [UIColor redColor]}];
[self.skipB setAttributedTitle:att forState:UIControlStateNormal];
现在通常(
最佳答案
希望这个帮助
NSMutableAttributedString * att = [[NSMutableAttributedString alloc] initWithString:@“跳过”属性:@ {NSForegroundColorAttributeName:[UIColor redColor]}];
[self.skipB setAttributedTitle:att forState:UIControlStateNormal];
和
[self.skipB setAttributedTitle:att forState:UIControlStateSelected];
关于ios - UIButton文本颜色在ios7中选择时发生更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19328387/