以编程方式触发StackNavigator导航?

时间:2017-12-29 05:37:30

标签: react-native react-navigation stack-navigator

我有StackNavigator,工作正常。但我想以编程方式导航到ScreenB,而无需用户点击选项卡,例如。使用这样的代码:

const ScreenNavigator = StackNavigator({
    A: { screen: ScreenA, },
    B: { screen: ScreenB, },
});
// There is no "navigate" method in StackNavigator
ScreenNavigator.navigate('B', { "foo": "bar" });

这可能吗?

最好是,如果我可以导航到ScreenB,以便ScreenA也在堆栈中,也就是说,按下'返回'而在ScreenB上进入ScreenA。

1 个答案:

答案 0 :(得分:0)

呼叫

public class AuthorizationContext : DbContext
{
    static AuthorizationContext()
    {
         QueryFilterManager.Filter<Orders>(q => q.Where(x => x.Price <= 5000));
    }

    public AuthorizationContext()
    {
         QueryFilterManager.InitilizeGlobalFilter(this);
    }
}
每当你想去SceneB

时,在SceneA中