幅指定をuseWindowDimensionsに変更

This commit is contained in:
harukin-OneMix4 2024-02-11 23:54:55 +09:00
parent 38052abd30
commit 93529f4f7d
2 changed files with 9 additions and 13 deletions

12
Apps.js
View File

@ -1,10 +1,4 @@
import React, {
useEffect,
useLayoutEffect,
useRef,
useState,
useCallback,
} from "react";
import React, { useEffect, useState } from "react";
import {
View,
Platform,
@ -16,10 +10,6 @@ import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import { Ionicons } from "@expo/vector-icons";
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp,
} from "react-native-responsive-screen";
import { AS } from "./storageControl";
import { news } from "./config/newsUpdate";
import { getStationList, lineList } from "./lib/getStationList";

View File

@ -1,5 +1,10 @@
import React from "react";
import { View, Text, TouchableOpacity } from "react-native";
import {
View,
Text,
TouchableOpacity,
useWindowDimensions,
} from "react-native";
import { StateBox } from "./StateBox";
import {
heightPercentageToDP,
@ -13,13 +18,14 @@ export const TrainDataView = ({
openTrainInfo,
mode = 0,
}) => {
const { width, height } = useWindowDimensions();
return (
<View
style={{
flexDirection: "row",
//minHeight: 200,
//height: heightPercentageToDP("20%"),
width: widthPercentageToDP("100%"),
width: width,
flex: 1,
}}
>