如何在导航栏动画期间删除不需要的黑色区域。截屏 [英] How to remove unwanted black area during navigation bar animation. Screen shots

查看:132
本文介绍了如何在导航栏动画期间删除不需要的黑色区域。截屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图控制器,导航栏是透明的。我的下一个视图是一个表格视图,其中导航栏是白色的。

I have a view controller, in which the navigation bar is transparent. My next view is a table view, in which the navigation bar is white.

要停止不需要的动画,我将导航栏设置为透明的'表视图的viewDidDissapear'。不幸的是,当我向后导航时,这会留下下面的图像(当你向前导航时更糟糕)。有谁知道如何摆脱黑色区域?

To stop an unwanted animation carrying over, I am setting the navigation bar to transparent in the 'viewDidDissapear' of the table view. Unfortunately this leaves me with the image below when I navigate back (its even worse when you navigate forward). Does anyone know how to get rid of the black area?

-(void)viewWillDisappear:(BOOL)animated     {


[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                                              forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;


[super viewWillDisappear:NO];

}

这是我在表格视图中使用的代码控制器。

This is the code I'm using in the table view controller.

推荐答案

正如你所说,不受欢迎的动画,。我建议你在tableViewController的两个(presentViewController& dismissViewController)中设置(动画:否)并在两个控制器的viewWillAppear中设置你的导航栏。我认为最好也很容易..

As you said, UNWANTED ANIMATIONS ,. i would suggest you to set (animated:NO) in both (presentViewController & dismissViewController) of your tableViewController……… and set your navigation bars in viewWillAppear of both controllers.. best and easy i think..

这篇关于如何在导航栏动画期间删除不需要的黑色区域。截屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆