From 263cb750ce1d1db53e2376a0838f6f7e99f75a58 Mon Sep 17 00:00:00 2001 From: harukin-OneMix4 Date: Tue, 9 Jan 2024 17:16:20 +0900 Subject: [PATCH] =?UTF-8?q?SafeAreaContext=E3=82=92=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 33 ++++++++++--------- .../ActionSheetComponents/EachTrainInfo.js | 6 +++- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/App.js b/App.js index 09ab333..87592e3 100644 --- a/App.js +++ b/App.js @@ -29,6 +29,7 @@ import { AllTrainDiagramProvider } from "./stateBox/useAllTrainDiagram.js"; import { SheetProvider } from "react-native-actions-sheet"; import "./components/ActionSheetComponents/sheets.js"; import { TrainDelayDataProvider } from "./stateBox/useTrainDelayData.js"; +import { SafeAreaProvider } from "react-native-safe-area-context"; LogBox.ignoreLogs([ "ViewPropTypes will be removed", "ColorPropType will be removed", @@ -43,21 +44,23 @@ if (Platform.OS === "android") { export default function App() { useEffect(() => UpdateAsync(), []); return ( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ); } export function AppContainer() { diff --git a/components/ActionSheetComponents/EachTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo.js index 5d0c64f..609f7f1 100644 --- a/components/ActionSheetComponents/EachTrainInfo.js +++ b/components/ActionSheetComponents/EachTrainInfo.js @@ -15,6 +15,7 @@ import ActionSheet, { SheetManager, useScrollHandlers, } from "react-native-actions-sheet"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; import { AS } from "../../storageControl"; import LottieView from "lottie-react-native"; import trainList from "../../assets/originData/trainList"; @@ -65,7 +66,7 @@ export const EachTrainInfo = (props) => { }) .catch((d) => AS.setItem("trainPositionSwitch", "false")); }, []); - + const insets = useSafeAreaInsets(); const getStationData = (stationName) => { const Stations = stationList.map((a) => a.filter((d) => d.StationName == stationName) @@ -264,6 +265,9 @@ export const EachTrainInfo = (props) => { CustomHeaderComponent={<>} ref={actionSheetRef} drawUnderStatusBar={false} + containerStyle={{ + paddingBottom: insets.bottom, + }} >