我有一個父 FlatList,它在其頁腳中可以呈現另一個平面串列或簡單的滾動視圖。
const renderFooter1 = () => {
return <ScrollView> ... </ScrollView>;
}
const renderFooter2 = () => {
return <FlatList ... />;
}
// Note: I am not doing this in real life, just an example for handling both possible footers
return (
<FlatList
refreshControl={renderRefreshControl()}
ListHeaderComponent={renderHeader()}
ListFooterComponent={Math.random() * 10 > 0.5 ? renderFooter1() : renderFooter2()}
showsVerticalScrollIndicator={false}
/>
);
我遇到的問題是,有時向下滾動時,滾動的組件是頁腳,而不是父串列。
我怎樣才能避免這種行為?
uj5u.com熱心網友回復:
您可以將道具添加scrollEnabled={false}到您不想滾動的任何 FlatList。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/319249.html
標籤:javascript 反应 反应原生
