0
我們正在使用Flatlist開發反應本機應用程序。綁定數據來自API服務&其工作正常。假設沒有可用的數據,我們需要爲此顯示單獨的設計。Flatlist React Native - 無數據顯示
我們使用「renderEmptyListComponent」爲
共享代碼,請
<FlatList style={{ backgroundColor: 'white' }}
data={this.state.dataSource}
renderItem={({ item }) => (this.renderMovie(item))}
keyExtractor={item => item.salesID}
renderEmptyListComponent= {this.noItemDisplay}
ItemSeparatorComponent={this.renderSeparator}>
</FlatList>
請指導我如何才能做到這一點?
有沒有這樣的道具「renderEmptyListComponent」。根據文檔,它是 「ListEmptyComponent」。 http://facebook.github.io/react-native/releases/0.47/docs/flatlist.html#flatlist – Dev