首页 > 解决方案 > 更新 pod 后,我收到此错误。无效的 UIAccessibilityTraits '选项卡'

问题描述

我正在使用 react-native-tab-view。我不确定这与此错误有关。

 <TabView
            bounces={false}
            navigationState={this.state}
            swipeEnabled={false}
            renderScene={() => null}
            renderTabBar={props => (
              <TabBar
                {...props}
                indicatorStyle={{
                  backgroundColor: "#212121",
                  height: "100%",
                  width: "38%",
                  marginLeft: "5%"
                }}
                style={{ backgroundColor: "#FFD54F" }}
                inactiveColor="#757575"
                activeColor={"#212121"}
                pressOpacity={0.9}
                tabStyle={{
                  backgroundColor: "#FFD54F",
                  marginBottom: 3
                }}
                labelStyle={{ fontWeight: "bold" }}
              />
            )}
            onIndexChange={index => this.setState({ index })}
            initialLayout={{
              width: Dimensions.get("window").width
            }}
          />
          {pages}

上面的代码在更新之前工作。

当我使用 react-native-tab-view 进入屏幕时会发生此错误。

我该如何解决这个问题?

谢谢!

在此处输入图像描述

标签: react-native

解决方案


这是版本问题。我刚刚重新安装了 react-native-tab-view@2.11.0。它奏效了!我希望这对其他人有用!


推荐阅读