iOSでキーボード関係でクラッシュするバグを修正
This commit is contained in:
parent
282ba84832
commit
3dc5f52333
@ -44,8 +44,9 @@ export const CarouselTypeChanger = ({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
behavior="padding"
|
behavior="position"
|
||||||
keyboardVerticalOffset={80}
|
contentContainerStyle={{ flex: 1, flexDirection: "row" }}
|
||||||
|
keyboardVerticalOffset={mapMode ? 0 : 45}
|
||||||
enabled={Platform.OS === "ios"}
|
enabled={Platform.OS === "ios"}
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
@ -12,8 +12,9 @@ import Ionicons from "react-native-vector-icons/Ionicons";
|
|||||||
import { useWindowDimensions } from "react-native";
|
import { useWindowDimensions } from "react-native";
|
||||||
import lineColorList from "@/assets/originData/lineColorList";
|
import lineColorList from "@/assets/originData/lineColorList";
|
||||||
import { lineList_LineWebID, stationIDPair } from "@/lib/getStationList";
|
import { lineList_LineWebID, stationIDPair } from "@/lib/getStationList";
|
||||||
export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
|
export const SearchUnitBox = ({ isSearchMode, setisSearchMode, }) => {
|
||||||
const { height, width } = useWindowDimensions();
|
const { height, width } = useWindowDimensions();
|
||||||
|
const [input, setInput] = React.useState("");
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
@ -39,16 +40,35 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
|
|||||||
>
|
>
|
||||||
{!isSearchMode && <Ionicons name="search" size={30} color="white" />}
|
{!isSearchMode && <Ionicons name="search" size={30} color="white" />}
|
||||||
{!!isSearchMode && (
|
{!!isSearchMode && (
|
||||||
<View style={{ backgroundColor: "#0099CC" }}>
|
<View style={{ backgroundColor: "#0099CC",flexDirection:"column",display:"flex",flex:1 }}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
backgroundColor: "white",
|
||||||
|
borderRadius: 25,
|
||||||
|
height: 30,
|
||||||
|
paddingRight: 10,
|
||||||
|
paddingLeft: 10,
|
||||||
|
flex: 1,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TextInput
|
||||||
|
placeholder="駅名を入力してフィルタリングします。"
|
||||||
|
onEndEditing={() => {}}
|
||||||
|
onChange={(ret) => setInput(ret.nativeEvent.text)}
|
||||||
|
value={input}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
||||||
<TouchableOpacity onPress={() => {
|
<TouchableOpacity
|
||||||
LayoutAnimation.configureNext({
|
onPress={() => {
|
||||||
duration: 100,
|
LayoutAnimation.configureNext({
|
||||||
update: { type: "easeInEaseOut", springDamping: 0.6 },
|
duration: 100,
|
||||||
});
|
update: { type: "easeInEaseOut", springDamping: 0.6 },
|
||||||
setisSearchMode(false);
|
});
|
||||||
}}>
|
setisSearchMode(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="arrow-back"
|
name="arrow-back"
|
||||||
size={20}
|
size={20}
|
||||||
@ -60,7 +80,8 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
|
|||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: lineColorList[stationIDPair[lineList_LineWebID[d]]],
|
backgroundColor:
|
||||||
|
lineColorList[stationIDPair[lineList_LineWebID[d]]],
|
||||||
padding: 5,
|
padding: 5,
|
||||||
marginHorizontal: 2,
|
marginHorizontal: 2,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
@ -68,7 +89,12 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
borderStyle: "solid",
|
borderStyle: "solid",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
opacity: isSearchMode == stationIDPair[lineList_LineWebID[d]] ? 1 : !isSearchMode ? 1 : 0.5,
|
opacity:
|
||||||
|
isSearchMode == stationIDPair[lineList_LineWebID[d]]
|
||||||
|
? 1
|
||||||
|
: !isSearchMode
|
||||||
|
? 1
|
||||||
|
: 0.5,
|
||||||
zIndex: 10,
|
zIndex: 10,
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
@ -86,25 +112,6 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
|
|||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
))}
|
))}
|
||||||
{/* <View
|
|
||||||
style={{
|
|
||||||
backgroundColor: "white",
|
|
||||||
borderRadius: 25,
|
|
||||||
height: 30,
|
|
||||||
paddingRight: 10,
|
|
||||||
paddingLeft: 10,
|
|
||||||
flex: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TextInput
|
|
||||||
placeholder="駅名を入力してフィルタリングします。"
|
|
||||||
//onFocus={() => setKeyBoardVisible(true)}
|
|
||||||
onEndEditing={() => {}}
|
|
||||||
//onChange={(ret) => setInput(ret.nativeEvent.text)}
|
|
||||||
//value={input}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
/>
|
|
||||||
</View> */}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
9
menu.js
9
menu.js
@ -34,7 +34,6 @@ import { useUserPosition } from "./stateBox/useUserPosition";
|
|||||||
import { AS } from "./storageControl";
|
import { AS } from "./storageControl";
|
||||||
import { lineList_LineWebID } from "./lib/getStationList";
|
import { lineList_LineWebID } from "./lib/getStationList";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { SearchUnitBox } from "./components/Menu/RailScope/SearchUnitBox";
|
|
||||||
configureReanimatedLogger({
|
configureReanimatedLogger({
|
||||||
level: ReanimatedLogLevel.error, // Set the log level to error
|
level: ReanimatedLogLevel.error, // Set the log level to error
|
||||||
strict: true, // Reanimated runs in strict mode by default
|
strict: true, // Reanimated runs in strict mode by default
|
||||||
@ -275,9 +274,9 @@ export default function Menu(props) {
|
|||||||
snapToEnd={false}
|
snapToEnd={false}
|
||||||
decelerationRate={"normal"}
|
decelerationRate={"normal"}
|
||||||
snapToOffsets={[mapHeight - 80]}
|
snapToOffsets={[mapHeight - 80]}
|
||||||
contentContainerStyle={{
|
// contentContainerStyle={{
|
||||||
position: "relative",
|
// position: "relative",
|
||||||
}}
|
// }}
|
||||||
onScrollBeginDrag={onScrollBeginDrag}
|
onScrollBeginDrag={onScrollBeginDrag}
|
||||||
onScrollEndDrag={(e) => {
|
onScrollEndDrag={(e) => {
|
||||||
if (e.nativeEvent.contentOffset.y < mapHeight - 80) {
|
if (e.nativeEvent.contentOffset.y < mapHeight - 80) {
|
||||||
@ -291,7 +290,7 @@ export default function Menu(props) {
|
|||||||
>
|
>
|
||||||
<MapView
|
<MapView
|
||||||
ref={mapsRef}
|
ref={mapsRef}
|
||||||
style={{ width: "100%", height: mapMode ? MapFullHeight : mapHeight }}
|
style={{ width: "100%", height:( mapMode ? MapFullHeight : mapHeight) }}
|
||||||
showsUserLocation={true}
|
showsUserLocation={true}
|
||||||
loadingEnabled={true}
|
loadingEnabled={true}
|
||||||
showsMyLocationButton={false}
|
showsMyLocationButton={false}
|
||||||
|
Loading…
Reference in New Issue
Block a user