2012-08-16 73 views
-2

我有一個應用程序與兩個ViewControllers。一個有一個WebView,另一個有一個按鈕。我希望按下按鈕時,在另一個ViewController中的WebView中攜帶一個頁面。UIButton導航到另一個ViewController的WebView

+1

期待一些downvotes。你應該做更多的分析和展示你的工作以獲得更多關注你的問題。 – Ravi 2012-08-17 00:06:02

回答

0

在Web上搜索UINavigationController的示例。

+0

這應該是一個評論 – swiftBoy 2012-08-18 20:29:35

0

在按一下按鈕,

-(void)ButtontnCliked:(UIButton*)sender 
{ 
    //create object of class to which you want to navigate. 

    NewView *viewController = [[NewView alloc]initWithNibName:@"NewView" bundle:nil]; //NewView is my new class 
    [self.navigationController pushViewController:viewController animated:YES]; // it will pushes your current view to newView. 
    [viewController release]; 
} 

注:假設你的RootViewController的是導航控制器。

相關問題