本文介绍了React Native中的自定义警报对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建具有图像背景和某些自定义样式的自定义警报对话框,但似乎无法找出如何在react-native中使用Alert或AlertIOS来执行此操作.这可能吗,或者有一些图书馆可以帮我忙吗?

I'm trying to create a custom alert dialog with an image background and some custom styling, but can't seem to find out how to do this using Alert or AlertIOS in react-native. Is this possible, or is there some library that can help me out?

推荐答案

AlertAlertIOS都利用每个平台的本机简单警报对话框.在iOS上,底层的本机组件非常简单,仅接受标题,消息和按钮,在Android上也是如此.

Both Alert and AlertIOS utilise each platform's native simple alert dialog. On iOS the underlying native component is simplistic and only accepts a title, message, and buttons, with a similar case on Android.

对于更自定义的方法,您可以使用 React Native Modalbox 反应本机模态-两者均提供了高度可定制的模态组件.

For a more custom approach you could use React Native Modalbox, or React Native Modal - both of which provide a highly-customisable modal component.

将来,我建议使用 JS.coach 以获得高质量的React Native组件的全面列表.

In future I'd recommend using JS.coach for a comprehensive list of quality React Native components.

这篇关于React Native中的自定义警报对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 22:25