Can I underline the text of a NSTextField from interface builder ?
So far, I've only able to change its color. Is there a way to underline it ?
thanks
No, you'd have to do it in code. For example:
NSMutableAttributedString *str = [[myTextField attributedStringValue] mutableCopy];
[str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(0, str.length)];
[myTextField setAttributedStringValue:str];
[str release];
Valid only for iOS
Yes, set attributed text, then select the text, right mouse click > Font > Underline
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With