我在Android平板电脑上使用HTML 标签在React Native的WebView中遇到了一个非常奇怪的问题。 出于某种原因,点击渲染的
按钮不会打开选项列表。
这只发生在Android平板电脑上,与Android版本无关。 但是,在Android智能手机上,不会发生此错误,并且选项列表会按预期打开。
为了重现这个bug,我创建了一个简单的演示应用程序: https : //github.com/huonderv/react-native-webview-html-select-bug 。
重要的代码如下:
index.android.js
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, WebView } from 'react-native'; export default class WebViewProject extends Component { render() { return ( ); } } const styles = StyleSheet.create({ container: { flex: 1, }, }); AppRegistry.registerComponent('WebViewProject', () => WebViewProject);
simpleselect.html
Volvo Saab Opel Audi
我还尝试用Crosswalk替换WebView,如下所述: https : //github.com/grovertb/react-native-crosswalk-webview 。 但是,这并没有解决这个问题。
有谁知道如何让这个在Android平板电脑上的React Native WebView中运行?