react-native - flatlist 用阿拉伯语口吃
问题描述
我正在使用 Flatlist 水平显示产品。当我在英语模式 RTL 下使用应用程序时,Flatlist 工作正常,在切换阿拉伯语 LTR 后,Flatlist 口吃,拖动后再次出现,我开始拖动 Flatlist 项目。
<ScrollView>
<FlatList
contentContainerStyle={styles.flatlist}
data={list}
keyExtractor={(item) => `post__${item.id}`}
renderItem={this.renderItem}
showsHorizontalScrollIndicator={false}
horizontal
pagingEnabled={isPaging}
onEndReached={false && this._nextPosts}
/>
</ScrollView>
解决方案
<ScrollView
horizontal
style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' }}
>
<FlatList
contentContainerStyle={styles.flatlist}
data={list}
keyExtractor={(item) => `post__${item.id}`}
renderItem={this.renderItem}
showsHorizontalScrollIndicator={false}
horizontal
pagingEnabled={isPaging}
onEndReached={false && this._nextPosts}
/>
</ScrollView>
我发现解决方案需要添加
horizontal
style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' }}
滚动视图中的行。
https://github.com/facebook/react-native/issues/11960#issuecomment-278918568
推荐阅读
- sql - SQL 中基于先前值的动态更新
- php - 检查 URL 在 Wordpress PHP 中是否有 ID
- apache - 为什么使用 Apache 的反向代理返回不同的结果?
- html - 使用 Selenium webdriver Chrome 从下拉列表中选择元素
- list - 如何在pyspark中拆分包含正斜杠的列表
- asp.net-core - 如何使用 Asp.net Core 在 Blazor 服务器端防止重复记录
- google-play-console - Android 应用程序包和动态模块交付
- java - unsatisfiedDependencyException org.springframework.beans.factory 的问题
- numpy - 我如何轻松地将元组numpy转换为张量流中的元组张量
- visual-studio-code - 下载 VSCode 源代码时 Chrome 消息“错误 - 检测到病毒”