我已成功使用iOS的scrollToIndex,但相同的代码不适用于android。有想法吗?
this.list.scrollToIndex({animated: true, index: tempIndex, viewOffset:0,viewPosition:0});
和我的单位列表
<FlatList
ref={(ref) => { this.list = ref; }}
initialNumToRender={15}
data={searchData}
scrollKey={'name'}
reverse={false}
itemHeight={30}
renderItem={({ item }) => (
<List
item={item} selectItem={()=>this.selectItem(item)}
/>
)}
refreshing={isFetching}
keyExtractor={item => item._id}
onRefresh={this.handleRefresh}
/>