0
如何從指定的UITextRange
中得到UITextView
的NSAttributedString
?我似乎無法找到任何示例或文檔資源。從UITextView獲取NSAttributedString和UITextRange
如何從指定的UITextRange
中得到UITextView
的NSAttributedString
?我似乎無法找到任何示例或文檔資源。從UITextView獲取NSAttributedString和UITextRange
沒關係,我發現它:
- (id)attribute:(NSString *)attributeName atIndex:(NSUInteger)index effectiveRange:(NSRangePointer)aRange
你能在評論請添加代碼是如何工作的。我需要在我的textview中爲不同的對象使用屬性字符串:title,detailtitle和其他。 – user2545330
@ user2545330您可以參考[documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/nsattributedstring_Class/Reference/Reference.html#//apple_ref/occ/) instm/NSAttributedString/attributesAtIndex:effectiveRange :)。這裏有很好的解釋。 –