hidesBottomBarWhenPushed推送时出现奇怪的动画行为 [英] hidesBottomBarWhenPushed weird animation behaviour when push
问题描述
我有一个基于标签的应用程序,其中没有标签栏.
I have a tab based application,Which contains no tab bar.
要隐藏标签栏,我正在情节提要中使用hidesBottomBarWhenPushed方法.
For hiding tab bar i am using hidesBottomBarWhenPushed method in storyboard.
但是使用此视图,我的力量动画如下所示: https://drive.google.com/file/d/14H3Lym0bat4kaYP5rSlFqkJp8QF1xd >
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 =是;
self.tabBarController.tabBar.hidden = YES;
Viewp中的
会出现,但不起作用. 我也试图在推送之前以编程方式将其隐藏,但没有运气
in Viewwillappear but did not work. also i have tried to hide it programatically before push but no luck
这是我的屏幕,正在产生问题. 我已经删除了用于隐藏选项卡栏的所有代码,现在仅从情节提要板中隐藏了hideBottomBarWhenPushed集. 但仍然遇到同样的问题.
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.
最后我尝试了:
let chatRoom = ChatDetailViewController.viewController()
chatRoom.hidesBottomBarWhenPushed = true
self.navigationController?.pushViewController(chatRoom, animated: true)
但结果相同.
以下是在推送过程中发生的动画的屏幕截图:
Here is the screenshot of animation which is happening during push:
推荐答案
viewcontroller.hidesBottomBarWhenPushed = true
在按下viewcontroller时,将hidesBottomBarWhenPushed
属性用作true
.
Use hidesBottomBarWhenPushed
property as true
when push viewcontroller.
viewcontroller是
UIViewController
的对象,该对象将被推入导航堆栈.
viewcontroller is object of
UIViewController
which are going to push into navigation stack.
这篇关于hidesBottomBarWhenPushed推送时出现奇怪的动画行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!