如何修复在 Android 移动设备上显示的 React Native Modal 中缺失的底部部分?

问题描述 投票:0回答:2

在 React Native 中,我有一个模态图像。

但是,当首次显示 Modal 时,会遇到底部缺失的错误。

This bug when Modal show in first time

当我尝试关闭模态并重新打开它时,它在全屏渲染下再次正常工作。

When I close and reopen modal again

我尝试使用尺寸(宽度,高度)和弹性,但不适合我的情况。

发生了什么以及我该如何解决这个问题。请帮助我。

  • 节点版本:18
  • React Native 版本:0.71
  • 设备:Redmi note 8 pro、三星 Galaxy note 10。
android react-native mobile modal-dialog dimension
2个回答
0
投票

我一周前就遇到过这个问题。 无法轻易修复。

我已经通过使用我的组件进行全屏“修复”了它,并且

react-navigation


0
投票

我找到了一种使用react-native-portalize库来修复它的方法。 这是您可以尝试的代码:

import { Host } from 'react-native-portalize';

<Host>
    <Modal>...</Modal>
</Host>
© www.soinside.com 2019 - 2024. All rights reserved.