How to remove unwanted black area during navigation bar animation. Screen shots

可紊 提交于 2019-12-12 22:13:38

问题


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.

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.


回答1:


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..



来源:https://stackoverflow.com/questions/19634448/how-to-remove-unwanted-black-area-during-navigation-bar-animation-screen-shots

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!