幅指定をuseWindowDimensionsに変更
This commit is contained in:
parent
38052abd30
commit
93529f4f7d
12
Apps.js
12
Apps.js
@ -1,10 +1,4 @@
|
|||||||
import React, {
|
import React, { useEffect, useState } from "react";
|
||||||
useEffect,
|
|
||||||
useLayoutEffect,
|
|
||||||
useRef,
|
|
||||||
useState,
|
|
||||||
useCallback,
|
|
||||||
} from "react";
|
|
||||||
import {
|
import {
|
||||||
View,
|
View,
|
||||||
Platform,
|
Platform,
|
||||||
@ -16,10 +10,6 @@ import { WebView } from "react-native-webview";
|
|||||||
import Constants from "expo-constants";
|
import Constants from "expo-constants";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
|
||||||
import {
|
|
||||||
widthPercentageToDP as wp,
|
|
||||||
heightPercentageToDP as hp,
|
|
||||||
} from "react-native-responsive-screen";
|
|
||||||
import { AS } from "./storageControl";
|
import { AS } from "./storageControl";
|
||||||
import { news } from "./config/newsUpdate";
|
import { news } from "./config/newsUpdate";
|
||||||
import { getStationList, lineList } from "./lib/getStationList";
|
import { getStationList, lineList } from "./lib/getStationList";
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { View, Text, TouchableOpacity } from "react-native";
|
import {
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
useWindowDimensions,
|
||||||
|
} from "react-native";
|
||||||
import { StateBox } from "./StateBox";
|
import { StateBox } from "./StateBox";
|
||||||
import {
|
import {
|
||||||
heightPercentageToDP,
|
heightPercentageToDP,
|
||||||
@ -13,13 +18,14 @@ export const TrainDataView = ({
|
|||||||
openTrainInfo,
|
openTrainInfo,
|
||||||
mode = 0,
|
mode = 0,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { width, height } = useWindowDimensions();
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
//minHeight: 200,
|
//minHeight: 200,
|
||||||
//height: heightPercentageToDP("20%"),
|
//height: heightPercentageToDP("20%"),
|
||||||
width: widthPercentageToDP("100%"),
|
width: width,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user