我想设置按钮标题用下划线和browncolor的:按钮标题颜色
对于我做的:
NSMutableAttributedString *nearestLocation = [[NSMutableAttributedString alloc] initWithString:@"Locate Manually"];
[nearestLocation addAttribute:(NSString*)kCTUnderlineStyleAttributeName
value:[NSNumber numberWithInt:NSUnderlineStyleSingle]
range:(NSRange){0,[nearestLocation length]}];
[btn_manually setAttributedTitle:nearestLocation forState:UIControlStateNormal];
[btn_manually setTitleColor:[UIColor brownColor] forState:UIControlStateNormal];
它显示下划线,但不能browncolor。
你需要使用NSMutableAttributedString喜欢你的下划线逻辑来设置颜色。 –