FlatList-scrollToEnd在Android中不起作用

时间:2018-12-18 09:22:38

标签: react-native react-native-flatlist

在android中,我无法滚动到最后一个索引,但在ios中工作正常。这是我的代码,请检查

scrollToEnd = () => {
        if (Platform.OS === 'ios') {
            this.listRef.scrollToEnd();
        } else {
            // /this.listRef.scrollTo({animated: true}, 0);
           // _.delay(this.listRef.scrollToEnd, 100);
            //_.delay(this.listRef.scrollTo({ y: 0}), 100);
            // setTimeout(() => {
            //     this.listRef.scrollToIndex({
            //       0,
            //       viewPosition: 0.5
            //     })
            //   }, 100)

           // this.listRef.current.scrollToEnd();

        }
    };

0 个答案:

没有答案
相关问题