首页 > 解决方案 > 如何在 react-native-navigation v2 中为所有屏幕添加固定标题?

问题描述

我想知道是否可以在 react-native-navigation v2 中为所有屏幕添加固定标题。像这样的东西:

<View style={{flex: 1}}>
    <View style={{flex: 0.3}}>
        <Text>Fixed Banner</Text>
    </View>
    <View style={{flex: 0.7}}>
        Navigation.setRoot({
            root: {
                bottomTabs: {
                    id: 'BottomTabsId',
                    children: [
                    {
                        component: {
                            name: 'SignIn',
                            options: {
                                bottomTab: {
                                    fontSize: 12,
                                    text: 'Sign In',
                                    icon: require('./signin.png')
                                 }
                             }
                        },
                   },
                   ...
              ],
          }
    </View>
</View>

每当我将标签切换到另一个屏幕时,理想情况下我希望始终看到相同的横幅。

标签: react-nativereact-native-navigation

解决方案


Show the banner in an Overlay.


推荐阅读