【发布时间】:2017-10-31 15:18:41
【问题描述】:
我的 FlatList 有问题,我无法滚动列表... 它是块,我的列表足以滚动
const tab_ad = [
{"id": 0, "Price": 100000, "key": 0},
{"id": 1, "Price": 100000, "key": 1},
{"id": 2, "Price": 100000, "key": 2},
{"id": 3, "Price": 100000, "key": 0},
{"id": 4, "Price": 100000, "key": 1},
{"id": 5, "Price": 100000, "key": 2},
{"id": 6, "Price": 100000, "key": 0},
{"id": 7, "Price": 100000, "key": 1},
{"id": 8, "Price": 100000, "key": 2},
]
export default class Event extends Component {
renderItem(item) {
return (
<Image source={path_default_picture} style={{width: 50, height: 50, margin: 5}}/>
);
}
render() {
return (
<View style={{flex: 1}}>
<FlatList
horizontal
data={tab_ad}
renderItem={(item) => this.renderItem(item)}
keyExtractor={(item, index) => index}
/>
</View>
);
}
react-native-cli: 2.0.1 反应原生:0.49.3
有人可以帮助我吗?
【问题讨论】:
-
列表没有滚动?
-
我在世博小吃中试过你的代码。它在那里工作得很好。只是将图像更改为视图。 snack.expo.io/HkcAOXLCb
-
我试过你的代码,它在我的最后工作正常。
标签: react-native jsx react-native-flatlist