反应原生水平平面列表不滚动

时间:2021-06-02 23:03:28

标签: arrays react-native react-native-flatlist flatlist

我有一个水平平面列表,但它没有滚动

我还不知道原因

有人可以帮我吗?

              <FlatList
                data={dashboardData}
                contentContainerStyle={{
                  width: '100%',
                  paddingHorizontal: 30,
                  flex: 1,
                }}
                keyExtractor={key => key}
                renderItem={renderItem}
                horizontal
                showsHorizontalScrollIndicator={false}
              />

1 个答案:

答案 0 :(得分:0)

contentContainerStyle 更新为,

...
contentContainerStyle={{
  //Remove `flex: 1` and `width` property, that will wrap all of the child views.
  paddingHorizontal: 30,
}}
...