我有Horizontal FlatList,现在我将电话语言更改为阿拉伯语(RTL)。 scrollToIndex()在RTL中不起作用,没有RTL,它可以按预期工作。有什么建议吗?
FlatList
<FlatList
style={myStyles.flatListStyle}
horizontal={true}
data={this.props.dataForFlatList}
renderItem={this.renderItem}
ref={(ref) => { this.flatListRef = ref; }}
keyExtractor={item => item.id.toString()} />
Press()上的renderItem函数正在传递项目ID
this.flatListRef.scrollToIndex({ animated: true, index: id }); // Working fine without RTL - NOT WORKING WITH RTL
谢谢。
答案 0 :(得分:0)
如果要滚动到渲染窗口之外,则需要指定getItemLayout
道具