我将我的代码从self.view = m_tabBarController.view;
更改为[self.view addSubview:m_tabBarController.view];
,我的看法似乎被推低了。为什么?addSubview将我的视图向下推
m_tabBarController是UITabBarController。
不知道为什么会发生这种情况。需要一些指导..谢谢
我将我的代码从self.view = m_tabBarController.view;
更改为[self.view addSubview:m_tabBarController.view];
,我的看法似乎被推低了。为什么?addSubview将我的视图向下推
m_tabBarController是UITabBarController。
不知道为什么会发生这种情况。需要一些指导..谢谢
在前面添加此[self.view addSubview:m_tabBarController.view];
m_tabBarController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
解决了这个问题。
这两个功能是为了不同的目的。
在此self.view = m_tabBarController.view;
要分配给m_tabBarController.view self.view
,并在此
[self.view addSubview:m_tabBarController.view];
你在self.view
加入m_tabBarController.view然后将你的视图的源代码放在这个函数中,因为你的self.view ha已经成为m_tabBarController.view的父类。
由于
如果我运行self.view = m_tabBarController.view;在ios6中,它给了我UIViewControllerHierarchyInconsistency问题。但addSubview在iOS6中正常工作... – lakesh 2013-02-14 10:37:33
addSubview方法将子视图添加到父级子视图列表的末尾。 – 2013-02-14 10:04:57
那么应该怎样正确的陈述? – lakesh 2013-02-14 10:06:25