我是iOS/Objective-c的新手,並試圖允許使用下劃線和罷工思想文本註釋,但這裏不是具有此功能的本機字體,可以添加某種屬性?iOS上的下劃線和刪除線
NSDictionary *arial = [NSDictionary dictionaryWithObjectsAndKeys:@"ArialMT", [NSNumber numberWithInt:TextAnnotationFontStyleNone],
@"Arial-BoldMT", [NSNumber numberWithInt:TextAnnotationStyleBold],
@"Arial-ItalicMT", [NSNumber numberWithInt:TextAnnotationStyleItalic],
@"Arial-BoldItalicMT", [NSNumber numberWithInt:TextAnnotationStyleBold | TextAnnotationStyleItalic],
@"Arial-BoldMT", [NSNumber numberWithInt:TextAnnotationStyleUnderline], // ANY WAY TO ADD ANYTHING HERE TO MAKE IT UNDERLINE???
nil];
的這個環節沒有簡單的方法來做到這一點的iOS示例項目代碼。看看這篇文章,http://stackoverflow.com/questions/5777570/text-underline-in-iphone –
NSAttributedString會給你下劃線,但只在iOS 6下。 – rmaddy