2011-08-05 9 views
0

我對Twitter的twui framework .I'm一個項目基地試圖做一個字符串點擊就像如何使用Twui使字符串可點擊?

[s addAttribute:NSLinkAttributeName value:@"http://apple.com/" range:attrRange]; 

在NSMutableAttributedString,或點擊時進行選擇。

TUITextRender可以繪製NSAttributedString,但「NSLinkAttributeName」不起作用。

我無法在TUITextView中找到任何方法或代理來解決這個問題。

我該怎麼用twui做到這一點?

+0

你已經找到了解決辦法?我有同樣的問題,我完全不知道如何做到這一點。 – nonamelive

+0

有點遲了,但你必須修改框架的NSMutableAttributedString + Additions。 –

回答

1

在閱讀源代碼後,我想通了。

  1. 將範圍存儲在ABActiveRange(其中包含twui)子類的數組中。
  2. 在您的UIViewController中執行TUITextRendererDelegate
  3. activeRangesForTextRenderer:委託方法,返回您在步驟作出的陣列1.
  4. 享受〜