如何在视图的 ImageBackround 中添加 createStackNavigator 以具有公共背景图像?

How to add createStackNavigator inside ImageBackround of view to have common background image?

我正在尝试从外部文件导入 createStackNavigator 并将其添加到 View 的 ImageBackground 中,这样我就可以从上到下拥有通用的背景图像流,但是我收到了如下错误 TypeError: 在导航状态

中找不到 "routes"

代码:

      <View style={styles1}>
        <ImageBackground source={{uri: 'https://upload.wikimedia.org/wikipedia/commons/3/36/Hopetoun_falls.jpg' }} style={{width: '100%', height: '100%'}}>
 <componentNavigator style={{ backgroundColor: 'transparent' }} navigation={navigation} />
   <View></View>

        </ImageBackground>
        {/*</ImageBackground>*/}
      </View >

为了解决上述问题,我添加了 静态路由器 = AccountsNavigator.router; // 添加到构造函数下面

然后我得到 Connot readt 属性 'router' of undefined 我不确定如何修复它,即使它修复了它是否会采用 flow og 背景图像?

我找到了解决方案,通过在 navigationOptions 中添加 headerTransparent: true,我可以实现透明背景,尽管我必须将下面的容器定位为 position: absolute