简体   繁体   English

显示 React Native Modal 时,如何使 android 导航栏透明?

[英]How can I make the android navigation bar transparent when React Native Modal is shown?

I use React Native CLI.我使用 React Native CLI。 With Alert, the full screen of the app is covered and the navigation bar becomes transparent.使用警报,应用程序的全屏被覆盖,导航栏变得透明。 However this does not happen with a Modal, which does not cover the navigation bar.但是,这不会发生在不覆盖导航栏的 Modal 中。 (and it looks a bit bad). (而且看起来有点糟糕)。 I don't understand why that happens and I'd be grateful if someone could help me out.我不明白为什么会发生这种情况,如果有人可以帮助我,我将不胜感激。

Example when using Modal.使用模态时的示例。

Example when using Alert.使用警报时的示例。

尝试将透明道具设置为“真” - https://reactnative.dev/docs/modal#transparent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使导航栏透明 - How to make the navigation bar transparent Android编程:如何在Android Nougat中使导航栏完全透明 - Android Programming: How to make navigation bar fully transparent in Android Nougat 如何在 Android Jetpack Compose 中使导航栏透明? - How to Make Navigation Bar Transparent in Android Jetpack Compose? 使 Android 通知栏透明而不是底部导航栏 - Make Android Notification Bar Transparent Not Bottom Navigation Bar 如何在 Android 上使图像透明? - How can I make an image transparent on Android? 我可以将快餐栏锚定到 Android 原生底部导航栏吗? - Can I anchor a snackbar to Android native bottom navigation bar? 如何使状态栏/导航栏在 Android 上不可见,同时保持屏幕顶部/底部的填充? - How can I make the status bar / navigation bar invisible on Android, while keeping the padding at the top / bottom of the screen? 如何在 android 工作室中使用 java 使 android 中的状态栏和底部导航透明? - How to make status bar and bottom navigation transparent in android using java in android studio? android中不能透明导航栏和状态栏 - Can't transparent navigation bar and status bar in android 在 React Native 中隐藏 Android 导航栏 - Hide Android Navigation Bar in React Native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM