【问题标题】:Allow the user to select and copy text in a TTStyledTextLabel允许用户选择和复制 TTStyledTextLabel 中的文本
【发布时间】:2010-11-21 14:23:35
【问题描述】:

我不确定这是Three20 问题还是一般的ios/iphone(我在这两个领域都是菜鸟。)

我目前在表格视图中使用TTStyledTextLabel 来呈现样式化的内容。现在我想允许用户选择文本并复制它。检查TTSTyledTextLabel 的来源我发现:

#pragma mark -
#pragma mark UIResponderStandardEditActions

- (void)copy:(id)sender {
  NSString* text = _text.rootNode.outerText;
  UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
  [pasteboard setValue:text forPasteboardType:@"public.utf8-plain-text"];
}

这表明标签已准备好帮助实际复制。但我不知道如何让它允许文本选择。

有什么想法吗?

【问题讨论】:

  • 我也在尝试做和你一样的事情,你知道怎么做吗?谢谢。
  • 不,除非这几乎是不可能的。我现在在 UI 中添加了引号按钮。

标签: iphone ios three20


【解决方案1】:

多年后重温...如果不大量重写 TTStyledText 类,这是不可能的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-11
    • 2018-01-19
    • 1970-01-01
    • 1970-01-01
    • 2017-07-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多