开发者

Create buttons from a text array

开发者 https://www.devze.com 2023-03-07 03:16 出处:网络
Sorry I can\'t think of a good title for this but here\' my situation: I have bunch of text in a UITextView, and I want开发者_JAVA技巧 some words to becomes buttons (the list of words can be in an arr

Sorry I can't think of a good title for this but here' my situation: I have bunch of text in a UITextView, and I want开发者_JAVA技巧 some words to becomes buttons (the list of words can be in an array)...and basically, when the user clicks these buttons, it will push a uiviewcontroller on the nav controller displaying details about that word....

My main problem is: How can I make these select words buttons? What the best way to do this? Thanks


If you don't need editing of the text I suggest using a UIWebView and making those words links. Then implement the UIWebViewDelegate method: webView:shouldStartLoadWithRequest:navigationType: and catch clicking of a link with it. Then show your viewcontroller.

0

精彩评论

暂无评论...
验证码 换一张
取 消