【发布时间】:2021-06-18 14:45:57
【问题描述】:
我有一个嵌入了 React Native 应用程序的片段,该应用程序在原生片段上加载视图。我的观点在两个移动平台上都呈现,并且在 iOS 上完美运行。我能够激活一个名为 RCTRootView.passThroughTouches
的属性有没有办法让触摸通过视图与后面的原生视图交互?
我的片段是按照https://reactnative.dev/docs/integration-with-android-fragment 的步骤创建的,并像这样添加到我的布局中:
val reactNativeFragment = ReactFragment.Builder()
.setComponentName("MainFABActionsContainer")
.build()
childFragmentManager
.beginTransaction()
.add(R.id.fab_actions, reactNativeFragment)
.commit()
我的 XML 中的框架布局如下所示:
<FrameLayout
android:id="@+id/fab_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
谢谢!
【问题讨论】:
标签: android ios react-native android-fragments