Androidでスクロールしなかった問題を解消
This commit is contained in:
parent
0618ff0180
commit
b2624d319b
@ -8,6 +8,7 @@ import {
|
||||
TouchableOpacity,
|
||||
TouchableWithoutFeedback,
|
||||
TouchableHighlight,
|
||||
Platform,
|
||||
} from "react-native";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import ActionSheet from "react-native-actions-sheet";
|
||||
@ -26,6 +27,7 @@ export const EachTrainInfo = ({
|
||||
from,
|
||||
}) => {
|
||||
const [trainData, setTrainData] = useState([]);
|
||||
const [isTop, setIsTop] = useState(true);
|
||||
const stationList =
|
||||
originalStationList &&
|
||||
lineList.map((d) =>
|
||||
@ -36,6 +38,7 @@ export const EachTrainInfo = ({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setIsTop(true);
|
||||
if (!data.trainNum) return;
|
||||
const TD = trainList[data.trainNum];
|
||||
if (!TD) {
|
||||
@ -60,7 +63,11 @@ export const EachTrainInfo = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<ActionSheet ref={setRef} gestureEnabled CustomHeaderComponent={<></>}>
|
||||
<ActionSheet
|
||||
ref={setRef}
|
||||
gestureEnabled={isTop}
|
||||
CustomHeaderComponent={<></>}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: "#0099CC",
|
||||
@ -114,7 +121,14 @@ export const EachTrainInfo = ({
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
<ScrollView style={{ maxHeight: heightPercentageToDP("70%") }}>
|
||||
<ScrollView
|
||||
style={{ maxHeight: heightPercentageToDP("70%") }}
|
||||
nestedScrollEnabled
|
||||
onScroll={(e) => {
|
||||
if (!Platform.OS !== "android") return;
|
||||
setIsTop(e.nativeEvent.contentOffset.y < 0);
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
padding: 10,
|
||||
|
Loading…
Reference in New Issue
Block a user