gpt4 book ai didi

objective-c - 将 subview 添加到 UITabBarController

转载 作者:行者123 更新时间:2023-11-28 20:29:07 25 4
gpt4 key购买 nike

我有一个 UITabController 和 3 个 UIViewController,每个对应 3 个选项卡。

在其中一个选项卡中,我想添加一个 subview (实际上我想用另一个 View 替换选项卡的内容。

这就是我正在做的:

QuestionClass *oView = [[QuestionClass alloc] initWithNibName:@"QuestionClass" bundle:[NSBundle mainBundle]];
[self presentModalViewController:oView animated:NO];

可以,但是标签栏是隐藏的,你知道要显示吗?

最佳答案

presentModalViewController: 的文档说:

在 iPhone 和 iPod touch 设备上,modalViewController 的 View 总是全屏显示。在 iPad 上,演示文稿取决于 modalPresentationStyle 属性中的值。

如果您使用的是 iPhone (iPod) 并希望您的 Controller 停留在选项卡 Controller 的 View 空间内,您应该考虑让导航 Controller 插入它。

关于objective-c - 将 subview 添加到 UITabBarController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12915313/

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