我创建了一张自定义动画底部表。用户可以上下移动底部滚动条。在我的底部工作表中,我使用了 flatList 来获取数据并将项目呈现为卡片。到目前为止,一切都按预期工作,但我遇到了平面列表滚动问题。在底部工作表内,平面列表不会滚动。我已经制作了硬编码的 height value 2000px,这确实是一种实践,而且 FlatListcontentContainerStyle添加了硬编码的 paddingBottom 2000(也是另一个不好的实践)。我想滚动基于Flex-box. 我不知道如何解决这个问题。
我在expo-snacks上分享我的代码
这是我的全部代码
import React, { useState, useEffect } from "react";
import {
StyleSheet,
Text,
View,
Dimensions,
useWindowDimensions,
SafeAreaView,
RefreshControl,
Animated,
Button,
FlatList,
} from "react-native";
import MapView from "react-native-maps";
import styled from "styled-components";
import {
PanGestureHandler,
PanGestureHandlerGestureEvent,
TouchableOpacity,
} from "react-native-gesture-handler";
const { width } = Dimensions.get("screen");
const initialRegion = {
latitudeDelta: 15,
longitudeDelta: 15,
latitude: 60.1098678,
longitude: 24.7385084,
};
const api = …Run Code Online (Sandbox Code Playgroud) padding scrollview flexbox react-native react-native-flatlist