gpt4 book ai didi

ios - 在弹出框内添加一个按钮

转载 作者:行者123 更新时间:2023-11-28 19:15:20 26 4
gpt4 key购买 nike

是否可以在 Xcode 中的弹出窗口中添加一个按钮,将用户带到新 View ?

最佳答案

是的。

[myPopOver.contentViewController.view addSubview:myButton];
[myButton addTarget:self action:@selector(goToNextView) forControlEvents:UIControlEventTouchUpInside];

- (void)goToNextView
{
//if you are using xibs use this line
UIViewController *controller = [[UIViewController alloc] initWithNibName:@"myXib" bundle:[NSBundle mainBundle]];
//if you are using storyboards use this line
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"myViewControllersID"];

//to present the controller modally use this
[self presentViewController:controller animated:YES completion:nil];
//or if you are pushing to this controller using a navigation controller use this
[self.navigationController pushViewController:controller animated:YES];
}

关于ios - 在弹出框内添加一个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12309355/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com