我应该如何添加链接在iPhone视图的底部

问题描述:

我有一个表格视图与4行,并在我需要显示一个URL链接的表格视图页脚的底部。它应该打开相应的网页。我应该如何添加链接在iPhone视图的底部

例如,我需要一个名为“Search using web”的链接,此链接的视图应为http://www.google.com。我怎样才能实现这个?

+0

你能显示你的截图吗? – 2012-02-21 11:55:15

首先,你的表视图

textView.text = @"Search using web"; 
textView.dataDetectorTypes = UIDataDetectorTypeLink; 

公开赛上的Safari中使用此代码的每一行中添加的UITextView ....

NSURL *url = [ [ NSURL alloc ] initWithString: @"http://www.google.com" ]; 
[[UIApplication sharedApplication] openURL:url]; 
[url release]; 

任何帮助使用本IOS Refernce

使用标签显示“使用Web搜索”文本。你也可以在文字上加下划线。然后在标签的触摸事件中编写代码以打开链接。

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    UITouch *touch= [touches anyObject]; 
    if ([touch view] == your_labelName) 
    { 
      write your code here to open the url.. 
    } 
}