我加載數據(Google,Yahoo,Facebook)UITableView
,當我點擊(Google)時,它應該使用UIWebView
重定向到Gmail頁面。如何在單擊UITableViewCell時導航UIWebView?
我在didSelectRowAtIndexPath
中寫什麼?
我加載數據(Google,Yahoo,Facebook)UITableView
,當我點擊(Google)時,它應該使用UIWebView
重定向到Gmail頁面。如何在單擊UITableViewCell時導航UIWebView?
我在didSelectRowAtIndexPath
中寫什麼?
創建包含的WebView,然後在TableViewController在didSelectRowAtIndexPath
方法添加該代碼視圖控制器具有特定URL的網頁視圖。
- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
WebViewController *WebViewController = [[TrackViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
//And do here code for passing URL to WebViewController
[self presentModalViewController:webViewController animated:NO];
}
如果您正在使用導航控制器比
- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
WebViewController *WebViewController = [[TrackViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
//And do here code for passing URL to WebViewController
[self.navigationController pushViewController:aTrackViewController animated:NO];
}
使用navigaion控制器,負載上didSelectRowAtIndexPath方法方法獲取和傳遞所選擇的URL從表
可以請您給我一些代碼? – user2264731 2013-04-10 06:29:29