ios – presentViewController显示黑页

ios – presentViewController显示黑页,第1张

概述- (IBAction)submitButtonClicked:(id)sender{ NSLog(@"here"); SuccessOrFailViewController *sfvc = [[SuccessOrFailViewController alloc] init]; [self presentViewController:sfvc animated:NO com


- (IBAction)submitbuttonClicked:(ID)sender{    NSLog(@"here");    SuccessOrFailVIEwController *sfvc = [[SuccessOrFailVIEwController alloc] init];    [self presentVIEwController:sfvc animated:NO completion:NulL];}

当用户点击应用中的提交按钮时,我试图打开一个新页面.但是,这完全没有打开黑屏.如何使它打开vIEwController?

解决方法 您没有为用户界面输入nib名称:

SuccessOrFailVIEwController *sfvc = [[SuccessOrFailVIEwController alloc] initWithNibname:@"SuccessOrFailVIEwController" bundle:nil];[self presentVIEwController:sfvc animated:NO completion:NulL];

对于故事板,这是要走的路:

UIStoryboard *storyboard = [UIStoryboard storyboarDWithname:@"MainStoryboard" bundle:nil];SuccessOrFailVIEwController *sfvc = [storyboard instantiateVIEwControllerWithIDentifIEr:@"SuccessOrFailVIEwController"];[sfvc setModalPresentationStyle:UIModalPresentationFullScreen];[self presentModalVIEwController:sfvc animated:YES];
总结

以上是内存溢出为你收集整理的ios – presentViewController显示黑页全部内容,希望文章能够帮你解决ios – presentViewController显示黑页所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1063984.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-26
下一篇2022-05-26

发表评论

登录后才能评论

评论列表(0条)

    保存