我构建了一个自定义选项卡导航,一切正常,我的问题是我想为所有页面使用背景视频,以防止它在每个新页面上加载,我想将视频放在根 app.tsx 中我放置 navigationContainer 的位置,但反应导航中的某些内容似乎添加了白色背景。
<NavigationContainer>
<BackgroundVideo/>
<Tab.Navigator screenOptions={{ headerShown: false }} tabBar={(props) => <BottomMenu {...props} />} >
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="About" component={About} />
<Tab.Screen name="Portfolio" component={Portfolio} />
<Tab.Screen name="Profile" component={Profile} />
<Tab.Screen name="Contact" component={Contact} />
</Tab.Navigator>
</NavigationContainer>
如果我将BackgroundVideo设置为绝对位置,它根本不显示视频,我只会看到白屏,如果我不设置绝对位置,我会看到视频和菜单,但不会看到来自任何Tab.Screen的页面内容.
将背景视频放置到每个页面上是可行的,但它会重新加载每个页面更改,我不喜欢这样。
有人知道更好的解决方案吗?