简体   繁体   English

使用 react-native 的 android 中的警报提示(输入值更新警报)不起作用(在 iOS 中工作)

[英]Alert prompt (Alert with input value update) not working in android using react-native (Working in iOS)

I am using Alert.prompt to update a text field in the react-native app.我正在使用 Alert.prompt 更新 react-native 应用程序中的文本字段。 But it not opening the alert in the android app.但它没有在 android 应用程序中打开警报。

In iOS app alert with input box update working fine.在 iOS 应用程序警报中,输入框更新工作正常。

onEditText = (field) => {
  Alert.prompt('Change ' + field + ':', this.props[field], (value) =>
   this.props.setProfileField(field, value),
 );
}

I think prompt for Android using react-native's Alert doesn't work really, the alternative you have is this:我认为使用 react-native 的 Alert 提示 Android 并没有真正起作用,您的替代方法是:

https://github.com/shimohq/react-native-prompt-android https://github.com/shimohq/react-native-prompt-android

This is a native alternative, for JS alternatives there would be:这是一个原生替代方案,对于 JS 替代方案,将有:

https://github.com/mmazzarolo/react-native-dialog https://github.com/mmazzarolo/react-native-dialog

https://www.npmjs.com/package/react-native-prompt-crossplatform https://www.npmjs.com/package/react-native-prompt-crossplatform

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM