簡體   English   中英

在 react-native-modalize 滑動的 android 上不起作用

[英]On android of react-native-modalize swipe is not working

在 react-native-modalize 的 android 上,無法通過滑動關閉模式。 在 IOS 上,它運行完美,沒有任何錯誤,甚至是模態框內的 ScrollView。 我試圖添加屬性,但它不起作用:

panGestureComponentEnabled={true}
panGestureEnabled={true}

我的配置:

"react-native": "0.65.1",
"react-native-gesture-handler": "^2.4.2",
"react-native-modalize": "^2.1.1",

請您分享您如何解決 android 上的此錯誤的經驗。

我找到了決定。 您需要像這樣將您的應用程序組件包裝到 GestureHandlerRootView 中:App.tsx

import {GestureHandlerRootView} from "react-native-gesture-handler"

const App = () => {

  return (
    <GestureHandlerRootView style={{flex: 1}}>
      <YourAppComponent />
    </GestureHandlerRootView>
  )
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM