导航栏不显示

发布于 2024-08-23 01:56:27 字数 365 浏览 4 评论 0原文

在基于选项卡栏的应用程序中,我从 tabview1 添加了一个新的 UIViewController,就像

[self.view addSubview:self.aView.view];

我在 IB 中为 aView 创建了笔尖一样。它是一个带有表格视图和导航栏的视图。我有 aView 和 bView,它们几乎相同,并以相同的方式添加到父级。唯一的区别是 aView 在其表视图中有两个部分。否则,视图的布局是相同的。

由于某种原因,aView 不显示其导航栏。它似乎也比 bView 高一点,因为我可以看到选项卡栏和 aView 之间的父视图的一小部分。我试图找出这两种视图之间可能导致此行为的任何差异,但找不到。我在忽略什么?

In a tab bar based app, I add a new UIViewController from tabview1 like this

[self.view addSubview:self.aView.view];

I created the nib for aView in IB. It is a view with a tableview and navigation bar. I have aView and bView, which are nearly the same and added to the parent the same way. The only difference is that aView has two sections in its tableview. Otherwise, the views are laid out the same.

For some reason, aView does not display its navigation bar. It also seems to sit a little higher than bView, since I can see a sliver of the parent view between the tab bar and aView. I've tried to find any differences between these two views that would cause this behavior but can't. What am I overlooking?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风透绣罗衣 2024-08-30 01:56:27

根据您的需要,您应该能够为每个 UIViewController 创建单独的笔尖,然后将每个笔尖设置为选项卡栏的每个 tar 中的第一个视图控制器加载,或者使用相同的笔尖在每个栏中设置这些笔尖

- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated

: Apple文档中的信息应该有所帮助:

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW14

< a href="http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW15" rel="nofollow noreferrer">http ://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW15

Depending on your needs you should be able to create separate nib's for each UIViewController then set each of these nib's to be loaded as the first view controller in each tar of the tabbar, or with the same nib's set these in each bar with:

- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated

The following info from the Apple docs should help:

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW14

http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW15

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文