0

我使用 Expo 和 flatlist 方法“scrollToEnd()”在 android 和 ios 上运行良好,但在 web 上不起作用。有什么办法可以解决这个问题,还是 web 上不支持方法 scrollToEnd()?

平面列表

             ListHeaderComponent={() => {
                return (
                  <Button onPress={() =>
                    this.flatList.current.scrollToIndex({index:3})}>
                  </Button>
  
                )
              }}
              ref={this.flatList} 
            data={DATA}
            renderItem={({ item }) => (
              <View style={{
                backgroundColor: '#f9c2ff',
                padding: 20,
                marginVertical: 8,
                marginHorizontal: 16,
              }}>
                <Text>
                  {item.title}
                </Text>
              </View>
            )}
            keyExtractor={item => item.id}
          >
4

0 回答 0