颤振:移至下一个屏幕时,CupertinoTabBar不会消失
问题描述:
我正在运行Google的Flutter Gallery示例:
I'm running the Flutter Gallery example from Google:
在下面的gif文件中,请注意当我从一个屏幕导航到下一个屏幕时,库比蒂诺选项卡栏如何停留在屏幕底部. 出现这种情况的原因是,它是位于父小部件CupertinoNavigationDemo内的小部件,并且在将选项卡换入和换出视图时,选项卡栏仍保留.
In the gif below, notice how when I navigate from one screen to the next, the Cupertino Tab Bar stays at the bottom of the screen. The reason why this is the case is that it is a widget that lays within the parent widget CupertinoNavigationDemo and while the tabs are swapped in and out of the view, the tab bar remains.
导航时是否有摆脱标签栏的方法?
Is there a way to get rid of the Tab Bar when navigating?
答
设置rootNavigator: true
Navigator.of(context, rootNavigator: true).push(MaterialPageRoute(
builder: (context) => "your new routes",
));