导航栏不显示
在基于选项卡栏的应用程序中,我从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的需要,您应该能够为每个 UIViewController 创建单独的笔尖,然后将每个笔尖设置为选项卡栏的每个 tar 中的第一个视图控制器加载,或者使用相同的笔尖在每个栏中设置这些笔尖
: 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:
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