【问题标题】:Get NSAttributedString from UITextView with UITextRange使用 UITextRange 从 UITextView 获取 NSAttributedString
【发布时间】:2013-09-21 11:52:05
【问题描述】:

我如何从指定的UITextRange 中的UITextView 中获取NSAttributedString?我似乎找不到这方面的任何示例或文档资源。

【问题讨论】:

    标签: ios cocoa-touch uitextview ios7 nsattributedstring


    【解决方案1】:

    没关系,我找到了它:

    - (id)attribute:(NSString *)attributeName atIndex:(NSUInteger)index effectiveRange:(NSRangePointer)aRange
    

    【讨论】:

    • 你能在评论中添加代码吗?它是如何工作的。我需要在我的文本视图中为不同的对象使用属性字符串:标题、详细标题和其他。
    • @user2545330 可以参考documentation。那里解释得很好。
    猜你喜欢
    • 1970-01-01
    • 2013-01-10
    • 2011-07-29
    • 1970-01-01
    • 1970-01-01
    • 2015-07-22
    • 1970-01-01
    • 1970-01-01
    • 2012-02-25
    相关资源
    最近更新 更多