问题
I have a tab based application,Which contains no tab bar.
For hiding tab bar i am using hidesBottomBarWhenPushed method in storyboard.
but using this my view have strength animation like : https://drive.google.com/file/d/14H3Lym0bat4kaYP5rSlFqkJp8QF1xdZm/view
The tab bar is visible for some time and then it goes down.
For the solution i have put the following code :
self.tabBarController.tabBar.hidden = YES;
in Viewwillappear but did not work. also i have tried to hide it programatically before push but no luck
Here is my screen which is creating issue. I have removed all the code for hiding the tab bar, Now only hidesBottomBarWhenPushed set from storyboard. But still getting same issue.
I have hide the Bottom bar for checking is it related to layouts, but still my whole view goes up to down for the fraction of second.
Finally I have tried :
let chatRoom = ChatDetailViewController.viewController()
chatRoom.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(chatRoom, animated: true)
But Same result.
Here is the screenshot of animation which is happening during push:
回答1:
viewcontroller.hidesBottomBarWhenPushed = true
Use hidesBottomBarWhenPushed
property as true
when push viewcontroller.
viewcontroller is object of
UIViewController
which are going to push into navigation stack.
来源:https://stackoverflow.com/questions/51963911/hidesbottombarwhenpushed-weird-animation-behaviour-when-push