Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在第一个选项卡的两个视图之间的过渡处,背景中第二个选项卡的视图(而不是应该的颜色)_Iphone_Objective C_Uiview_Transition - Fatal编程技术网

Iphone 在第一个选项卡的两个视图之间的过渡处,背景中第二个选项卡的视图(而不是应该的颜色)

Iphone 在第一个选项卡的两个视图之间的过渡处,背景中第二个选项卡的视图(而不是应该的颜色),iphone,objective-c,uiview,transition,Iphone,Objective C,Uiview,Transition,我有一个带有四个选项卡的tabbar应用程序。每个选项卡都使用其viewcontroller加载一个nib。 在我的第一个笔尖中,我有两个视图。在第一个视图(占位符)中有一个按钮,用于切换到第二个视图(视图1)并反转(使用布尔值查看第二个视图是否位于顶部) 问题是: 当我点击按钮时,它工作正常。但是第二个选项卡栏笔尖在动画背景上? 当我单击第二个选项卡栏并返回第一个选项卡栏时,动画背景是白色的(应该是白色的) 在主Appdelegate中,我只添加了两个控制器: [window addSubvi

我有一个带有四个选项卡的tabbar应用程序。每个选项卡都使用其viewcontroller加载一个nib。 在我的第一个笔尖中,我有两个视图。在第一个视图(占位符)中有一个按钮,用于切换到第二个视图(视图1)并反转(使用布尔值查看第二个视图是否位于顶部)

问题是: 当我点击按钮时,它工作正常。但是第二个选项卡栏笔尖在动画背景上? 当我单击第二个选项卡栏并返回第一个选项卡栏时,动画背景是白色的(应该是白色的)

在主Appdelegate中,我只添加了两个控制器:

[window addSubview:navigationController.view];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];

有什么想法吗?

将navigationController.view和tabBarController.view添加为UIWindow的子视图可能会导致此问题。而不是此视图层次结构:

UIWindow->[UIAbbarController->[view,view,…],UINavigationController->view]

尝试仅将tabBarController的视图添加到窗口,并让它为每个选项卡管理单独的UINavigationController:


UIWindow->UIAbbarController->[UINavigationController->view,UINavigationController->view,…]

此问题可能是由于同时添加navigationController.view和tabBarController.view作为UIWindow的子视图而引起的。而不是此视图层次结构:

UIWindow->[UIAbbarController->[view,view,…],UINavigationController->view]

尝试仅将tabBarController的视图添加到窗口,并让它为每个选项卡管理单独的UINavigationController:

UIWindow->UIAbbarController->[UINavigationController->视图,UINavigationController->视图,…]

[window addSubview:navigationController.view];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];