我想知道是否有一种简单的方法可以在 iPhone 上删除/删除一些文本?
谢谢
NSMutableAttributedString *strikeThroughString = [[NSMutableAttributedString alloc] initWithString:anyString];
[strikeThroughString addAttribute:NSStrikethroughStyleAttributeName value:(NSNumber *)kCFBooleanTrue range:NSMakeRange(0, [as length])];
[m_cObjTaskTitle setAttributedText:strikeThroughString =];
cObjTaskTitle = UILabel ;
是与否,
NSString 是一个简单的类,它只存储无格式的文本,但是你可以使用一个 NSAttributedString 来存储这样的信息,即
NSAttributedString* italicText = [[NSAttributedString alloc] initWithString:myNsString attributes:myCrossOutAttributes];