草庐IT

TTTAttributedLabel

全部标签

ios - (NSCFType set) - iOS 6 中无法识别的选择器

我使用的是很棒的TTTAttributedLabel(https://github.com/mattt/TTTAttributedLabel),它在iOS5下运行良好。但是在iOS6下,我收到错误:-[__NSCFTypeset]:unrecognizedselectorsenttoinstance0x200020e0***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[__NSCFTypeset]:unrecognizedselectorsenttoinstance0x200020e

ios - 当其 super View 上有 UITapGestureRecognizer 时,点击 URL 在 TTTAttributedLabel 中不起作用

上面有容器View和一个UITapGestureRecognizer。它还有一个subview,类型为TTTAtributedLabel。当我从容器View中删除手势识别器时,TTTAtributedLabelDelegate的委托(delegate)方法-(void)attributedLabel:(TTTAttributedLabel*)labeldidSelectLinkWithURL:(NSURL*)urlcanbecalled.当我在容器View上添加手势识别器时。只有它的Action方法被调用。TTTAtributedLabelDelegate的委托(delegate)方法

ios - 当其 super View 上有 UITapGestureRecognizer 时,点击 URL 在 TTTAttributedLabel 中不起作用

上面有容器View和一个UITapGestureRecognizer。它还有一个subview,类型为TTTAtributedLabel。当我从容器View中删除手势识别器时,TTTAtributedLabelDelegate的委托(delegate)方法-(void)attributedLabel:(TTTAttributedLabel*)labeldidSelectLinkWithURL:(NSURL*)urlcanbecalled.当我在容器View上添加手势识别器时。只有它的Action方法被调用。TTTAtributedLabelDelegate的委托(delegate)方法

ios - TTTAttributedLabel 的链接点击颜色

我在我的项目中使用TTTAttributedLabel。我通过修改链接属性成功地更改了我创建的任何链接的默认颜色和下划线。NSArray*pKeys=[[NSArrayalloc]initWithObjects:(id)kCTForegroundColorAttributeName,(id)kCTUnderlineStyleAttributeName,nil];NSArray*pObjects=[[NSArrayalloc]initWithObjects:pAlertColor,[NSNumbernumberWithInt:kCTUnderlineStyleNone],nil];NSD

ios - TTTAttributedLabel 的链接点击颜色

我在我的项目中使用TTTAttributedLabel。我通过修改链接属性成功地更改了我创建的任何链接的默认颜色和下划线。NSArray*pKeys=[[NSArrayalloc]initWithObjects:(id)kCTForegroundColorAttributeName,(id)kCTUnderlineStyleAttributeName,nil];NSArray*pObjects=[[NSArrayalloc]initWithObjects:pAlertColor,[NSNumbernumberWithInt:kCTUnderlineStyleNone],nil];NSD

iphone - TTTAttributedLabel 中的单词被截断

我正在使用TTTAttributedLabel,但现在当我尝试显示一些链接时,它会从中心切掉这个词,就像您在附图中看到的那样,“fun”这个词在“f”和“un”出现后被切掉了下一行。但我希望完整的单词应该显示在第一行或下一行。任何帮助。if([_labelisKindOfClass:[TTTAttributedLabelclass]]){TTTAttributedLabel*tttLabel=(TTTAttributedLabel*)_label;[tttLabelsetDelegate:self];[tttLabelsetDataDetectorTypes:UIDataDetecto

ios - 在 TTTAttributedLabel 中获取点击 URL 的文本部分

我需要TTTAtributedLabel的点击部分的文本://initialize-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{...//AttributedMessageLabelNSMutableAttributedString*messageTextAttr=[rowvalueForKey:@"message_text_attr"];cell.messageText.attributedText=messageTextAttr;ce

ios - Xcode UIAutomation 无法与 TTTAttributedLabel 交互

我正在尝试为我的应用程序编写自动化脚本,但我的问题是XcodeUIAutomation无法看到TTTAttributedLabel的元素。类(class)。获取完整的元素树不会显示那些TTTAtributedLabel元素的迹象。我正在使用Xcode6.1.1 最佳答案 默认情况下TTTAtributedLabel不是无障碍元素。它作为自定义容器工作,并为链接/电话和其他检测到的数据提供可访问性。要更改此行为子类TTTAtributedLabel并覆盖UIAccessibilityElement协议(protocol)的方法。例如在

ios - TTTAttributedLabel 可点击截断 token

我有一个TTTAttributedLabel并为其指定了一个自定义属性截断标记:NSAttributedString*atributedTruncationToken=[[[NSAttributedStringalloc]initWithString:@"More..."attributes:@{NSForegroundColorAttributeName:[UIColorlightGrayColor],NSFontAttributeName:self.messageLabel.font,NSDocumentTypeDocumentAttribute:NSHTMLTextDocumen

ios - 具有表情符号时 TTTAttributedLabel 不显示最后一行

我们使用“TTTAtributedLabel”来显示标签。为了计算正确的矩形大小,我们使用NSString的“sizeWithFont”方法,并使用“constrainedToSize”字段的宽度。计算没问题,除非文本中有一些Emoji符号,并且文本是多行的(例如:smiley-newLine-smiley)。在那种情况下,返回的尺寸太小(垂直),最后一行没有显示。如果文本不包含任何表情符号(例如X-newLine-X)-大小正确。我们的字体是“HelveticaNeue”大小:16.25,以防有任何差异。有没有更好的方法来计算所需的大小,以便它也能与Emoji一起使用?谢谢