iosで表示されないバグを修正

This commit is contained in:
harukin-OneMix4 2024-02-14 02:18:32 +09:00
parent e967dfac2f
commit a713ae576d
2 changed files with 8 additions and 7 deletions

View File

@ -275,7 +275,7 @@ export const EachTrainInfoCore = ({
scrollViewProps={scrollHandlers} scrollViewProps={scrollHandlers}
containerProps={{ containerProps={{
style: { style: {
maxHeight: isLandscape ? height - 94 : heightPercentageToDP("70%"), maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
}, },
}} }}
Max_Header_Height={from == "AllTrainDiagramView" ? 0 : 200} Max_Header_Height={from == "AllTrainDiagramView" ? 0 : 200}

View File

@ -1,4 +1,4 @@
import { ScrollView, View, Animated } from "react-native"; import { ScrollView, View, Animated, Platform } from "react-native";
import React, { useRef } from "react"; import React, { useRef } from "react";
export const DynamicHeaderScrollView = (props) => { export const DynamicHeaderScrollView = (props) => {
@ -18,28 +18,28 @@ export const DynamicHeaderScrollView = (props) => {
const Scroll_Distance = Max_Header_Height - Min_Header_Height; const Scroll_Distance = Max_Header_Height - Min_Header_Height;
const animatedHeaderHeight = scrollOffsetY.interpolate({ const animatedHeaderHeight = scrollOffsetY.interpolate({
inputRange: [Scroll_Distance, Scroll_Distance + 10], inputRange: [Scroll_Distance, Scroll_Distance + 30],
outputRange: [Max_Header_Height, 0], outputRange: [Max_Header_Height, 0],
extrapolate: "clamp", extrapolate: "clamp",
}); });
const animatedHeaderHeight2 = scrollOffsetY.interpolate({ const animatedHeaderHeight2 = scrollOffsetY.interpolate({
inputRange: [0, Scroll_Distance], inputRange: [Scroll_Distance, Scroll_Distance + 30],
outputRange: [Max_Header_Height, Min_Header_Height], outputRange: [Max_Header_Height, Min_Header_Height],
extrapolate: "clamp", extrapolate: "clamp",
}); });
const animatedHeaderVisible = scrollOffsetY.interpolate({ const animatedHeaderVisible = scrollOffsetY.interpolate({
inputRange: [Min_Header_Height, Scroll_Distance], inputRange: [Scroll_Distance - 30, Scroll_Distance],
outputRange: [1, 0], outputRange: [1, 0],
extrapolate: "clamp", extrapolate: "clamp",
}); });
const animatedHeaderVisible2 = scrollOffsetY.interpolate({ const animatedHeaderVisible2 = scrollOffsetY.interpolate({
inputRange: [Min_Header_Height, Scroll_Distance], inputRange: [Scroll_Distance - 30, Scroll_Distance + 30],
outputRange: [0, 1], outputRange: [0, 1],
extrapolate: "clamp", extrapolate: "clamp",
}); });
return ( return (
<View {...containerProps}> <View {...containerProps}>
<View style={{ position: "relative" }}> <View style={{ zIndex: 1 }}>
<Animated.View <Animated.View
style={[ style={[
styles.header, styles.header,
@ -73,6 +73,7 @@ export const DynamicHeaderScrollView = (props) => {
{...scrollViewProps} {...scrollViewProps}
style={{ style={{
backgroundColor: "white", backgroundColor: "white",
zIndex: 0,
}} }}
stickyHeaderIndices={[1]} stickyHeaderIndices={[1]}
scrollEventThrottle={16} scrollEventThrottle={16}