views:

92

answers:

1

With the three20 library you can create styled text, including links, but how do you get those links to open in Safari (or within the app itself)?

+1  A: 

If you're using the three20 example, it should do it automatically. Please look at the TTCatalog sample in the source code samples folder.

http://github.com/facebook/three20/blob/master/samples/TTCatalog/Classes/StyledTextTableTestController.m

Also, once the page is open in your app in three20's built-in webview, there is an option to "Open in Safari" that the user can utilize as well if they want additional functionality such as bookmarking, etc. It will also handle PDF, youtube videos, etc. It's really a great framework to use.

iWasRobbed
Yes, I saw the TTCatalog sample, but when I create my own it doesn't show the webview, so i'd like to know what the mechanism is for capturing that click and opening a page.
cannyboy
I wonder if it's because I don't use TTNavigator to create my navigation view. That would be annoying, since I don't want to have to re-engineer my entire app
cannyboy
You may want to look here: http://github.com/facebook/three20/blob/master/src/Three20Style/Sources/TTStyledTextParser.m
iWasRobbed
Looks like it may be dependent on TTNav.. a better source to ask is @ www.three20.info here's some more: http://github.com/facebook/three20/blob/master/src/Three20Style/Sources/TTStyledLinkNode.m
iWasRobbed