RCAttributedLabel Class Reference
Inherits from | UILabel |
---|---|
Conforms to | RCAttributedDataSource UIGestureRecognizerDelegate |
Declared in | RCAttributedLabel.h |
attributeDataSource
可以通过设置attributeDataSource或者attributeDictionary、highlightedAttributeDictionary来自定义不同文本的字体颜色
@property (nonatomic, strong) id<RCAttributedDataSource> attributeDataSource
Discussion
可以通过设置attributeDataSource或者attributeDictionary、highlightedAttributeDictionary来自定义不同文本的字体颜色
Declared In
RCAttributedLabel.h
attributedStrings
可以通过设置attributedStrings可以给一些字符添加点击事件等,例如在实现的会话列表里修改文本消息内容 -(void)willDisplayConversationTableCell:(RCMessageBaseCell )cell atIndexPath:(NSIndexPath )indexPath{
@property (nonatomic, strong) NSMutableArray *attributedStrings
Discussion
可以通过设置attributedStrings可以给一些字符添加点击事件等,例如在实现的会话列表里修改文本消息内容 -(void)willDisplayConversationTableCell:(RCMessageBaseCell )cell atIndexPath:(NSIndexPath )indexPath{
if ([cell isKindOfClass:[RCTextMessageCell class]]) { RCTextMessageCell newCell = (RCTextMessageCell )cell; if (newCell.textLabel.text.length>3) { NSTextCheckingResult *textCheckingResult = [NSTextCheckingResult linkCheckingResultWithRange:(NSMakeRange(0, 3)) URL:[NSURL URLWithString:@“http://www.baidu.com”]]; [newCell.textLabel.attributedStrings addObject:textCheckingResult]; [newCell.textLabel setTextHighlighted:YES atPoint:CGPointMake(0, 3)]; } } }
Declared In
RCAttributedLabel.h
delegate
点击回调
@property (nonatomic, weak) id<RCAttributedLabelDelegate> delegate
Discussion
点击回调
Declared In
RCAttributedLabel.h
attributeDictionary
attributeDictionary
@property (nonatomic, strong) NSDictionary *attributeDictionary
Discussion
attributeDictionary
Declared In
RCAttributedLabel.h
highlightedAttributeDictionary
highlightedAttributeDictionary
@property (nonatomic, strong) NSDictionary *highlightedAttributeDictionary
Discussion
highlightedAttributeDictionary
Declared In
RCAttributedLabel.h
textCheckingTypes
NSTextCheckingTypes 格式类型
@property (nonatomic, assign) NSTextCheckingTypes textCheckingTypes
Discussion
NSTextCheckingTypes 格式类型
Declared In
RCAttributedLabel.h
currentTextCheckingType
NSTextCheckingTypes current格式类型
@property (nonatomic, readonly, assign) NSTextCheckingType currentTextCheckingType
Discussion
NSTextCheckingTypes current格式类型
Declared In
RCAttributedLabel.h
– setText:dataDetectorEnabled:
setTextdataDetectorEnabled
- (void)setText:(NSString *)text dataDetectorEnabled:(BOOL)dataDetectorEnabled
Parameters
text |
text |
---|---|
dataDetectorEnabled |
dataDetectorEnabled |
Discussion
setTextdataDetectorEnabled
Declared In
RCAttributedLabel.h
– setTextHighlighted:atPoint:
setTextHighlighted
- (void)setTextHighlighted:(BOOL)highlighted atPoint:(CGPoint)point
Parameters
highlighted |
highlighted |
---|---|
point |
point |
Discussion
setTextHighlighted
Declared In
RCAttributedLabel.h