Iphone 如何在iPad的DetailViewController中加载其他视图
如何在单击一个按钮时将Nib文件中的视图加载到iPad的DetailView中,然后在另一个按钮单击时返回到上一个视图在子视图中显示。我发现这个站点很有用:Iphone 如何在iPad的DetailViewController中加载其他视图,iphone,xcode,ipad,Iphone,Xcode,Ipad,如何在单击一个按钮时将Nib文件中的视图加载到iPad的DetailView中,然后在另一个按钮单击时返回到上一个视图在子视图中显示。我发现这个站点很有用: 以下代码应该会引导您朝着正确的方向前进 要加载新的ViewController,请执行以下操作: - (IBAction)myBtnPushed{ NSLog(@"myBtnPushed"); NewRightVC *newRightVC = [[NewRightVC alloc] initWithNibName:@"NewRightVC
以下代码应该会引导您朝着正确的方向前进 要加载新的ViewController,请执行以下操作:
- (IBAction)myBtnPushed{
NSLog(@"myBtnPushed");
NewRightVC *newRightVC = [[NewRightVC alloc] initWithNibName:@"NewRightVC" bundle:[NSBundle mainBundle]];
[detailViewController.navigationController pushViewController:newRightVC animated:YES];
NewLeftVC *newLeftVC = [[NewLeftVC alloc] initWithNibName:@"NewLeftVC" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:newLeftVC animated:YES];
}
[detailViewController.navigationController popViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];
要返回UISplitViewController中的RootViewController和DefaultViewController,请执行以下操作:
- (IBAction)myBtnPushed{
NSLog(@"myBtnPushed");
NewRightVC *newRightVC = [[NewRightVC alloc] initWithNibName:@"NewRightVC" bundle:[NSBundle mainBundle]];
[detailViewController.navigationController pushViewController:newRightVC animated:YES];
NewLeftVC *newLeftVC = [[NewLeftVC alloc] initWithNibName:@"NewLeftVC" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:newLeftVC animated:YES];
}
[detailViewController.navigationController popViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];