在这种情况下,superView 是什么? (标签栏应用程序)
我有一个只有 1 个选项卡的选项卡栏应用程序。
这是我的 didFinishLaunchingWithOptions
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
OneDayViewController *oneDayView = [[OneDayViewController alloc] initWithNibName:@"OneDayView" bundle:nil];
tabBarController.viewControllers = [NSArray arrayWithObject:oneDayView];
[self.window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES; }
在 OneDayViewController
中的任何方法中,我都有以下代码:
UIView *superView = [self.view superview];
问题是:现在 superView
是什么?用户界面视图? UIViewController 或...我不知道(对此感到抱歉)
P/S:我问这个是因为我想删除 OneDayView 并向选项卡添加另一个视图。
非常感谢你。
I have a tabbar app with only 1 tab.
Here is my didFinishLaunchingWithOptions
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
OneDayViewController *oneDayView = [[OneDayViewController alloc] initWithNibName:@"OneDayView" bundle:nil];
tabBarController.viewControllers = [NSArray arrayWithObject:oneDayView];
[self.window addSubview:tabBarController.view];
[self.window makeKeyAndVisible];
return YES; }
In any method in OneDayViewController
, I have this code:
UIView *superView = [self.view superview];
Question is: what is superView
now? UIView? UIViewController or ... I don't know (sorry about that)
P/S: I ask this because I want to remove OneDayView and add another view to tabbar.
Thanks you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的超级视图将是 tabBarController.view...
(之前我已经告诉过它是窗口,我错了...)
发布显示/推送 OneDayViewController 的代码...这样我们就可以清楚地了解超级视图...
Your superview will be tabBarController.view...
(Earlier i have told it is window I was wrong...)
post the code that showing/pushing OneDayViewController... so we can get clear idea about the superview...