react-native - react-native-swipeout 不适用于android
问题描述
它适用于 ios,但有些不适用于 Android。我正在使用tab navigation
和FlatList
。在里面FlatList
我正在使用Swipeout
. 下面以代码为例。
const renderItem =()=>{
return (
<Swipeout {...swipeAction(index,item, 'REMOVE ITEM',) }>
<View>
<Text>Swipe me left</Text>
</View>
</Swipeout>
)
}
const list= <FlatList renderItem={renderItem} />
TabNavigator({
itemList: { screen: list },
navigationOptions: {
header: null,
}
})
解决方案
只需为选项卡导航器添加一个额外的参数。swipeEnabled: false
const renderItem =()=>{
return (
<Swipeout {...swipeAction(index,item, 'REMOVE ITEM',) }>
<View>
<Text>Swipe me left</Text>
</View>
</Swipeout>
)
}
const list = <FlatList renderItem={renderItem} />
TabNavigator({
itemList: { screen: list },
navigationOptions: {
header: null,
swipeEnabled: false,
}
})
推荐阅读
- php - 如何从特定于用户会话 ID 的多个表中检索列?
- mysql - 2个相同的sql请求,一长一短
- angular - 具有可变角度的 navigationByUrl
- r - 在优化中为目标函数中的每个输入组合找到最佳参数
- javascript - 如何过滤表中的数据
- python - 如何通过在python中提取标题的部分名称来重塑数据框?
- jboss - 无法加载:自定义 OracleValidConnectionChecker
- javascript - Angular 9. 重新授权并使用新会话重试该功能
- vb.net - 如何合并具有不同列和行数的两个数据表
- postgresql - Spark Scala Dataframe:如何处理 PostgreSQL 表中的货币数据类型?