开发者

How do you make an Image View a Hyperlink on the iPhone?

My question is this: in many free iPhone apps adds which are basicall开发者_如何学Cy imageViews are buttons. When pressed, they bring you to the iphone App store to buy whichever app was advertised. Can this be tweaked to open a hyperlink in the iphone's safari browser? and if so, how?


The App Store links are already simple hyperlinks, but the system notices that they point to the app store and opens the App Store app right away. The links are opened using the openURL: method of the UIApplication class:

NSURL *url = [NSURL URLWithString:@"http://www.stackoverflow.com/"];
[[UIApplication sharedApplication] openURL:url];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜