从呈现的弹出视图控制器中推送视图控制器
pushing a view controller from presented popup view controller
我将视图控制器显示为弹出窗口,在弹出视图控制器中我有一个按钮,单击该按钮我试图按下视图控制器,但 click.How 上没有任何反应来执行此操作?
将视图控制器显示为弹出窗口
- (IBAction)sendOTPAction:(id)sender {
HMResetPasswordViewController *resetPassword = [self.storyboard instantiateViewControllerWithIdentifier:@"HMResetPasswordViewController"];
// configure the Popover presentation controller
resetPassword.modalPresentationStyle = UIModalPresentationPopover;
resetPassword.preferredContentSize = CGSizeMake(self.view.frame.size.width-10, 375);
resetPassword.popoverPresentationController.delegate = self;
resetPassword.popoverPresentationController.permittedArrowDirections = 0;
resetPassword.popoverPresentationController.sourceView = self.view;
resetPassword.popoverPresentationController.sourceRect = CGRectMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds),0,0);
[self presentViewController:resetPassword animated:YES completion:nil];
}
正在尝试从弹出视图控制器中推送视图控制器
- (IBAction)resetButtonAction:(id)sender {
HMLoginViewController *HMLoginViewController= [self.storyboard instantiateViewControllerWithIdentifier:@"HMLoginViewController"];
[self.navigationController pushViewController:HMLoginViewController animated:YES];
}
呈现后,如果您想使用导航堆栈,则必须创建新的导航控制器:
- (IBAction)resetButtonAction:(id)sender {
HMLoginViewController *HMLoginViewController= [self.storyboard instantiateViewControllerWithIdentifier:@"HMLoginViewController"];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:HMLoginViewController];
[self presentViewController:nc animated:YES];
}
在HMLoginViewController之后,现在你可以推送到其他UIViewController
我将视图控制器显示为弹出窗口,在弹出视图控制器中我有一个按钮,单击该按钮我试图按下视图控制器,但 click.How 上没有任何反应来执行此操作?
将视图控制器显示为弹出窗口
- (IBAction)sendOTPAction:(id)sender {
HMResetPasswordViewController *resetPassword = [self.storyboard instantiateViewControllerWithIdentifier:@"HMResetPasswordViewController"];
// configure the Popover presentation controller
resetPassword.modalPresentationStyle = UIModalPresentationPopover;
resetPassword.preferredContentSize = CGSizeMake(self.view.frame.size.width-10, 375);
resetPassword.popoverPresentationController.delegate = self;
resetPassword.popoverPresentationController.permittedArrowDirections = 0;
resetPassword.popoverPresentationController.sourceView = self.view;
resetPassword.popoverPresentationController.sourceRect = CGRectMake(CGRectGetMidX(self.view.bounds), CGRectGetMidY(self.view.bounds),0,0);
[self presentViewController:resetPassword animated:YES completion:nil];
}
正在尝试从弹出视图控制器中推送视图控制器
- (IBAction)resetButtonAction:(id)sender {
HMLoginViewController *HMLoginViewController= [self.storyboard instantiateViewControllerWithIdentifier:@"HMLoginViewController"];
[self.navigationController pushViewController:HMLoginViewController animated:YES];
}
呈现后,如果您想使用导航堆栈,则必须创建新的导航控制器:
- (IBAction)resetButtonAction:(id)sender {
HMLoginViewController *HMLoginViewController= [self.storyboard instantiateViewControllerWithIdentifier:@"HMLoginViewController"];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:HMLoginViewController];
[self presentViewController:nc animated:YES];
}
在HMLoginViewController之后,现在你可以推送到其他UIViewController