标签: react-native-navigation-v2

wix-react-native-navigation v2 statusBar不起作用

我正在尝试react-native-navigation V2但无法更改状态栏颜色。

Navigation.setDefaultOptions({
 statusBar: {
 visible: true,
 style: "dark",
 backgroundColor: "red"
},
topBar: {
 background: {
  color: COLOR.primaryColor
 },
 title: {
  text: "ExampleWix",
  fontSize: 22,
  color: "white"
 },
 visible: true
}
});
Run Code Online (Sandbox Code Playgroud)

但这仅在操作栏上起作用,而在状态栏上没有任何反应,它保持白色。我正在使用RN v = 0.54.2和react-native-navigation = 2.0.2373

更新

更新您的颜色RNN,您就可以更改status bar颜色

react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2

4
推荐指数
1
解决办法
1087
查看次数

4
推荐指数
1
解决办法
8120
查看次数

按下按钮打开SideMenu

我目前正在尝试从V1升级到react-native-navigation V2,并试图找到一种方法来切换顶部栏按钮按下的侧面菜单.

我的应用程序开始

Navigation.setRoot({
        root: {
          sideMenu: {
            left: {
              component: {
                name: 'testApp.SideDrawer',
                passProps: {
                  text: 'This is a left side menu screen'
                }
              }
            },
            center: {
              bottomTabs: {
                ...
              }
            },
          },
        },

      });
Run Code Online (Sandbox Code Playgroud)

有没有办法在当前版本中执行此操作?

react-native-navigation react-native-navigation-v2

2
推荐指数
1
解决办法
3671
查看次数

WIX Navigation V2 - 推送到新屏幕时隐藏底部标签栏

问题说明

我有TabBar基础应用程序,在我的一个标签中我需要将其推送到另一个屏幕,但标签栏不应显示在推动的屏幕中.但是底部栏仍然存在于推动的屏幕中.我想要实现的并不是完全隐藏底部标签栏,而是将推动的屏幕放在标签栏的顶部.

重现/编码片段/截图的步骤

这是我显示标签栏应用程序的代码:

bottomTabs: { id: 'BottomTabsId', children: [ { stack: { children: [ { component: { name: 'Home', options: { topBar: { backButton: { title: 'Back', }, title: { text: 'Home' } }, bottomTab: { fontSize: 12, text: 'Home', icon: require('./src/assets/home.png'), selectedIcon: require('./src/assets/home_active.png') }, }, }, } ] } }, { stack: { children: [ { component: { name: 'Booking', options: { topBar: { title: { text: 'Booking' } }, bottomTab: { text: 'Booking', fontSize: 12, icon: require('./src/assets/booking.png'), …

react-native react-native-navigation wix-react-native-navigation react-native-navigation-v2

2
推荐指数
1
解决办法
2877
查看次数

Wix React Native Navigation V2 - 自定义导航转换

Wix React Native Navigation V2 自定义导航过渡

像我这样的内容版主可能会被这个问题绊倒并标记为重复,因为有类似命名的库,如 React Navigation,与此无关。

有没有一种通用的方法来为 push/pop 自定义过渡动画?实验后,文档似乎稀疏且不正确。

默认推送动画从右向左移动。在某些情况下,我希望能够将其覆盖为从左到右或从上到下等。

在使用“动画”和“x”或“y”属性时,按推送/弹出执行此操作似乎不起作用。

这是我尝试过的示例。

class MyComponent extends React.PureComponent {
  static options(passProps) {
    return {
      animations: {
        push: {
          content: {
            x: {
              from: -1000, to: 0, duration: 300
            },
            y: {
              from: 0, to: 0, duration: 300
            }
          }
        },
        pop: {
          content: {
            x: {
              from: 0, to: -1000, duration: 300
            },
            y: {
              from: 0, to: 0, duration: 300
            }
          }
        }
      }
    }
  }
} …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-navigation-v2

2
推荐指数
1
解决办法
1384
查看次数

在 UIManager 中找不到“RNSScreenStackHeaderConfig”不会消失

我在 Mac OS 12 上并尝试构建 IOS 应用程序,但由于某种原因,错误: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager.似乎无论我做什么都不会消失。这是每当我重新加载 Metro 时的 Metro 输出:在此输入图像描述

这是我的代码:

import React, { useState } from 'react';
import { Text, View, Image, StyleSheet, StatusBar, ScrollView } from 'react-native';

import fetch from 'node-fetch';

import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import Main from './pages/main';

const Stack = createNativeStackNavigator();

const YourApp = () => {

    return (
        <NavigationContainer>
        
            <Stack.Navigator>
                <Stack.Screen name="Main" component={Main} /> …
Run Code Online (Sandbox Code Playgroud)

react-native react-navigation react-native-navigation-v2

2
推荐指数
1
解决办法
3384
查看次数