I was looking at the Twitter for iPhone app and was puzzled.
First of all, there are normal words looking like links inside.
Second, when I touch those link-like words, the text view (or maybe web view) jumps to the corresponding part below (yes, it doesn't open Safari, it just jumps to the text within that text/web view)
Now I want to implement the same effects.
- I should base my implementation on what? UITextView or UIWebView?
- How to make normal words look like links?
- How to make those smooth jumps within such a text/web views?
Thanks in advance.
You can use a HTML file with anchor tags in it. Add it in Resources folder as .htm and load it on webview. When you click on those links it will go the corresponding linked part within the page.
Include a local .
html
file in your projectFor example :
Finally display it in a
UIWebView
Have you considered the three20 library? In one of its demos,
TTCatalog
, there are samples of displaying exactly what you're looking for. What's great about the project is that you can use HTML to do the styling -- it'll know to convert an anchor, for example, into a clickable button.