ScrollViewからFlatListに変更

This commit is contained in:
harukin-OneMix4 2023-12-29 02:08:24 +09:00
parent e4ce671e67
commit 23402aef79

View File

@ -5,6 +5,7 @@ import {
TouchableOpacity, TouchableOpacity,
Linking, Linking,
ScrollView, ScrollView,
FlatList,
} from "react-native"; } from "react-native";
import MapView, { Marker } from "react-native-maps"; import MapView, { Marker } from "react-native-maps";
import { MaterialCommunityIcons } from "@expo/vector-icons"; import { MaterialCommunityIcons } from "@expo/vector-icons";
@ -58,12 +59,14 @@ export default function AllTrainDiagramView({ navigation: { navigate } }) {
}; };
return ( return (
<View style={{ backgroundColor: "#0099CC", height: "100%" }}> <View style={{ backgroundColor: "#0099CC", height: "100%" }}>
<ScrollView> <FlatList
{keyList && data={keyList}
keyList.map((key) => ( renderItem={({ item }) => (
<Item openTrainInfo={openTrainInfo} key={key} id={key} /> <Item openTrainInfo={openTrainInfo} id={item} />
))} )}
</ScrollView> keyExtractor={(item) => item}
initialNumToRender={100}
/>
<TouchableOpacity <TouchableOpacity
style={{ style={{