通过 UIButton 加载/关闭程序化(非 xib)视图
大家好 - 最后一个愚蠢的问题(我希望)
我遇到了以下情况发生的情况。
以编程方式创建的视图(因为它对于我正在做的事情来说是最简单的) 用户点击按钮,基于 Xib 的视图出现,使用以下代码加载基于 Xib 的视图 (InfoView2)
InfoView2 *infoView2 = [[InfoView2 alloc] initWithNibName:@"InfoView2" bundle:nil];
[self.navigationController pushViewController:infoView2 animated:YES];
[infoView2 release];
现在,我想删除 InfoView2 并返回到 TapView,即以编程方式创建的视图 - 我觉得这应该相对简单,但是每个指南和我能找到的教程显示了如何加载基于 Xib 的视图,我找不到用于非 Xib 的视图的教程...我是不是很厚?我是否以错误的方式加载 InfoView2?
我应该注意这是针对 iPhone 应用程序的 - 对于应用程序的 iPad 端,我在 popoverViewController 中加载 InfoView2,因为它本质上是应用程序的设置。
有人能够提供一些见解吗?
老实说...最后一篇愚蠢的帖子...我保证。请少说几句;) 12 小时的一天即将结束。
Hey all - last dumb question (I hope)
I've got a situation whereby the following happens.
Progmatically created view (because it's easiest for what I'm doing)
User taps button, Xib based view appears using following code to load the Xib based view (InfoView2)
InfoView2 *infoView2 = [[InfoView2 alloc] initWithNibName:@"InfoView2" bundle:nil];
[self.navigationController pushViewController:infoView2 animated:YES];
[infoView2 release];
Now, I want to remove InfoView2 and go back to TapView, the progmatically created view - I feel this should be relatively simple, but every guide and tutorial I can find shows how to load Xib based views, I can't find one for non-Xib based views...am I being thick? Am I loading InfoView2 in the wrong way to start with?
I should note this is for an iPhone app - for the iPad side of the app I load InfoView2 in a popoverViewController as it's essentially the settings for the app.
Anyone able to offer some insight?
Honestly...last daft post...I promise. Small words please ;) 12 hour day coming to an end.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它是 uiView 还是 uiviewController ???
如果它是 UIView 控制器,那么在视图控制器上执行所需操作后,您所要做的就是代码:
[self.navigationController popViewControllerAnimated:YES];
如果您想要动画返回或
[self.navigationController popViewControllerAnimated:NO];
为了“干”回报......
Is it a uiView or uiviewController???
if it is a UIView controller all you have to do after doing what you need on the view controller yse the code:
[self.navigationController popViewControllerAnimated:YES];
if you want an animated return or
[self.navigationController popViewControllerAnimated:NO];
for a "dry" return...