如何过滤ListView?
我在Firebase中有图像,并试图通过ListView加载它们。但是,我想根据Firebase中同一表中的访问权限对它们进行筛选。表中的列是 1.名称 2.描述 3.通路 仅当access>0时,我才尝试加载图像数组。我如何在我的代码或建议中实现这一点?谢谢你的帮助。顺便说一下,我是个新手:-)如何过滤ListView?,listview,react-native,Listview,React Native,我在Firebase中有图像,并试图通过ListView加载它们。但是,我想根据Firebase中同一表中的访问权限对它们进行筛选。表中的列是 1.名称 2.描述 3.通路 仅当access>0时,我才尝试加载图像数组。我如何在我的代码或建议中实现这一点?谢谢你的帮助。顺便说一下,我是个新手:-) 任何人谢谢你的帮助!任何人谢谢你的帮助! constructor(props){ super(props); dataSource: new ListView.DataSource({
任何人谢谢你的帮助!任何人谢谢你的帮助!
constructor(props){
super(props);
dataSource: new ListView.DataSource({
rowHasChanged: (row1, row2) => row1 !== row2,
})
}
listenForProfiles(dataRef) {
dataRef.on('value', (snap) => {
var images = [];
snap.forEach((child) => {
images.push({
name: child.val().uploadLink,
description: child.val().uploadDescription,
_key: child.key
});
});
this.setState({
dataSource: this.state.dataSource.cloneWithRows(images)
});
});
}
componentDidMount() {
this.listenForProfiles(this.dataRef);
}