更新时间:2021-11-22 04:19:29
您可以将自己的容器添加到现有布局.例如:
You can add your own container to the existing layout. For example:
window.decorView.findViewById<ViewGroup>(android.R.id.content)
.addView(
FrameLayout(this).apply {
id = R.id.fragment_container
layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT
)
}
)
现在,您可以将片段添加到此容器中. 另外,此库可能会有所帮助- https://github.com/hudl/react-native -android-fragment
Now you can add your fragment to this container. Also this library might be helpful - https://github.com/hudl/react-native-android-fragment