在视图中加载 nib 文件时出现问题!
我创建了 2 个名为“FirstView”和“SecondView”的视图。两个视图都有 nib 文件。现在我完美地获得了“FirstView”nib 文件,然后单击时,我将 SecondView 推入窗口中。 SecondView 已加载,但笔尖未显示在该视图中。它完全是白色的!
更改视图的代码:
svc = [[signupViewController alloc] initWithNibName:@"signupViewController" bundle:nil];
[vc.view removeFromSuperview];
[window addSubview:svc.view];
任何人都可以帮忙吗?
谢谢。
- 阿山
I have created 2 views named "FirstView" and "SecondView". Both views have nib files. Now I am getting the "FirstView" nib file perfectly and then on click, I am pushing my SecondView in the window. The SecondView gets loaded but the nib is not shown in that view. Its totally white!
code to change the view:
svc = [[signupViewController alloc] initWithNibName:@"signupViewController" bundle:nil];
[vc.view removeFromSuperview];
[window addSubview:svc.view];
Can anyone kindly help ?
Thanks.
-
ahsan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您有两个控制器,一个用于 FirstView,另一个用于 SecondView。因此,如果您以编程方式分配控制器,请确保使用 initWithNibName 初始化 secondaryViewController:此时,当您执行presentModalViewController 或pushViewController 时,您应该能够看到您的nib 视图。
I suppose you have two controllers, one for FirstView and a second one for SecondView. So if you are allocating your controller programmatically make sure you are initializing the secondViewController with initWithNibName: at this point when you perform presentModalViewController or pushViewController you should be able to see your nib view.