【发布时间】:2021-02-12 02:53:53
【问题描述】:
这是一个非常奇怪的问题.....当我不调试时,一切正常......但是一旦我打开调试 FlatList 中 ListItem 的 onPress 功能就不再响应按下。 这只是昨天才开始发生的,我还没有进行任何代码更改。代码如下:
import { StyleSheet, Text, View, FlatList, ActivityIndicator, Alert } from 'react-native';
import {ListItem, Avatar} from 'react-native-elements';
<FlatList
data={this.props.data}
keyExtractor={(item, index) => {
return index.toString();
}}
return (
<View>
<ListItem
onPress={() => {
this.props.flatListItemPressHandler(item);
}}>
<ListItem.Content>
<ListItem.Title style={{fontWeight: 'bold', fontSize: 20}}>
{item.name}
</ListItem.Title>
</ListItem.Content>
<ListItem.Chevron />
</ListItem>
</View>
);
}}
ItemSeparatorComponent={this.renderSeparator}
onEndReached={this.props._handleLoadMore}
onEndReachedThreshold={0.3}
/>
【问题讨论】:
-
同样的问题,通过你的问题发现它只是处于调试模式。谢谢。
标签: react-native react-native-android react-native-elements