简体   繁体   English

将视图添加为子视图时,为什么看不到整个选项卡栏?

[英]Why can't i see my whole tab bar when i add it in a view as subview?

I am new to iPhone development. 我是iPhone开发的新手。 I am working with an navigational based application and want to add a tab bar view in my application. 我正在使用基于导航的应用程序,并想在我的应用程序中添加标签栏视图。 For that i created a view called TabBarView and added a UITabBarController outlet. 为此,我创建了一个名为TabBarView的视图,并添加了一个UITabBarController插座。 viewDidLoad of my TabBarViewController.m is like this: 我的TabBarViewController.m的viewDidLoad是这样的:

 - (void)viewDidLoad {
[self.view addSubview:tabBarController.view];
[super viewDidLoad];
 } 

When i watch it in simulator, i can't see my whole tab bar. 当我在模拟器中观看时,看不到我的整个标签栏。 I can just see half of it. 我只能看到一半。 I went through some tutorials and tried to set view size, but i couldn't. 我浏览了一些教程,尝试设置视图大小,但是我做不到。 Can anyone tell me why can't i see whole tab bar and how to fix it. 谁能告诉我为什么我看不到整个标签栏以及如何解决它。 Thanks in advance. 提前致谢。

make sure that the size of view is 480 cause you see half of it because you have status bar of 20 so your view is 460 please 确保视图的大小为480,因为状态栏为20,所以您只能看到一半,因此视图为460。

Your view without statusbar is 480 with it 460 so when you add tabbar with 40 pixel so you have to make the view of size 480... so not to hide the 20 of status bar 您不带状态栏的视图是480,带460,因此当您添加40像素的标签栏时,您必须使视图大小为480 ...以便不要隐藏状态栏的20

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么当我删除子视图时我的视图变成白色? - Why does my view become white when i remove a subview? 无法将第二个标签栏添加到标签栏控制器视图 - Can't add a second tab bar to tab bar controller view 如何在iPhone的一个标签下显示视图和子视图? - How can I have a view and a subview under one tab on the iphone? 在调试过程中使用断点时,为什么在iPad Simulator中看不到标签? - Why Can't I See My Labels in the iPad Simulator When I Use Breakpoints During Debug? 我可以在同一View Controller中添加两个选项卡栏吗,底部一个选项卡栏,顶部一个选项卡栏 - Can i Add Two Tab Bars in same View controller one tab bar at bottom and one tab bar at top 在iOS应用中,即使没有添加主自定义UIView,我仍然可以将其他视图对象添加为子视图吗? - In an iOS app, even when no main custom UIView is added, I can still add other view objects as subview? 如何在标签栏中添加条件? - how can i add condition in tab bar? 为什么我看不到iPod的任何控制台日志? - Why can't I see any console logs for my iPod? 我不能添加一个子视图,但通过init方法 - I can't add a subView but through the init method iPhone,我如何向mainWindow添加一次显示一次的视图,但没有标签栏按钮? - iPhone, how can I add a first view, show once, to a mainWindow but not have a tab bar button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM