【问题标题】:How should I add a link at the bottom of the View in iPhone我应该如何在 iPhone 的视图底部添加一个链接
【发布时间】:2012-02-21 11:44:48
【问题描述】:
【问题讨论】:
标签:
iphone
objective-c
xcode
uitableview
uiwebview
【解决方案1】:
首先你在表格视图的每一行中添加 UITextView
textView.text = @"Search using web";
textView.dataDetectorTypes = UIDataDetectorTypeLink;
Open On The safari 使用此代码....
NSURL *url = [ [ NSURL alloc ] initWithString: @"http://www.google.com" ];
[[UIApplication sharedApplication] openURL:url];
[url release];
任何帮助使用这个IOS Refernce
【解决方案2】:
使用标签显示“使用 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..
}
}