Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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
Objective c 在iOS 7上使用HidesBottomBar时出现奇怪的动画,当在应用程序内置的目标定位中使用HidesBottomBar时<;=iOS 6_Objective C_Animation_Ios6_Ios7_Uikit - Fatal编程技术网

Objective c 在iOS 7上使用HidesBottomBar时出现奇怪的动画,当在应用程序内置的目标定位中使用HidesBottomBar时<;=iOS 6

Objective c 在iOS 7上使用HidesBottomBar时出现奇怪的动画,当在应用程序内置的目标定位中使用HidesBottomBar时<;=iOS 6,objective-c,animation,ios6,ios7,uikit,Objective C,Animation,Ios6,Ios7,Uikit,当我构建一个针对iOS 5或6的应用程序,但在iOS 7上运行时,就会出现这个问题。如果navigationController中有一个控制器是tabBarController的一部分,我会执行以下操作: controller.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:testController animated:YES]; 出现奇怪的垂直定位动画。相反,我希望新控制器(隐藏底部

当我构建一个针对iOS 5或6的应用程序,但在iOS 7上运行时,就会出现这个问题。如果navigationController中有一个控制器是tabBarController的一部分,我会执行以下操作:

controller.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:testController animated:YES];
出现奇怪的垂直定位动画。相反,我希望新控制器(隐藏底部栏)在导航控制器上推动或弹出,将选项卡栏推出或带回来,而不改变垂直位置

发行视频:


打开雷达报告:

您始终可以使用

[self.view.layer removeAllAnimations];
干杯

试试这个:

[self.navigationController.navigationBar setHidden:NO];
试试这个

if( [self respondsToSelector:@selector(setEdgesForExtendedLayout:)] )
{
    self.edgesForExtendedLayout=UIRectEdgeNone;
}

这说明你应该:

self.navigationController.navigationBar.translucent = NO;

按照此操作,只需将导航栏和tabBarController的半透明属性设置为“否”。这将解决您的问题。

如果要保持透明度,请将其添加到根
UIViewController

- (void)viewWillAppear:(BOOL)animated {
    [UIView animateWithDuration:0.35f animations:^{
        self.tabBarController.tabBar.alpha = 1.0f;
    }];
}

- (void)viewWillDisappear:(BOOL)animated {
    [UIView animateWithDuration:0.35f animations:^{
        self.tabBarController.tabBar.alpha = 0.0f;
    }];
}

通过这种方式,您将在选项卡栏中获得一个很好的淡入/淡出动画。

这里有一个解决方案,您为什么要针对旧SDK进行编译?您可以针对较旧的iOS版本,同时根据较新的SDK进行编译。在针对iOS7 SDK进行编译时是否会出现这种情况?从2014年2月开始,您将无法再使用低于iOS7的SDK向AppStore提交应用程序或修补程序。是时候继续前进了。2月14日之后,你仍然可以为iOS7之前的版本构建应用程序。您只需要使用Xcode 5和iOS7 SDK构建它。对于ios 7问题,您可以使用自定义动画:检查此动画: