【发布时间】:2018-08-22 17:49:21
【问题描述】:
我想在 react-native webview 中设置 textarea autoFoucs,但它不起作用?有人知道怎么解决吗?请联系我,谢谢!
<WebView
ref={ref => this.webView = ref}
automaticallyAdjustContentInsets={false}
style={{ width: this.mScreenWidth, flex: 1, backgroundColor: '#fff', marginTop: this._getSize(5), paddingHorizontal: this._getSize(16), paddingTop: this._getSize(5) }}
source={{ uri: 'http://localhost:8081/richEditor/richEditor.html' }}
javaScriptEnabled={true}
dataDetectorTypes='none'
startInLoadingState={true}
scrollEnabled={true} />
<textarea id="textarea" autofocus="autofocus"></textarea> <script type="text/javascript" charset="utf-8"> document.getElementById("textarea").focus(); </script>
【问题讨论】:
-
1.人们不应该联系你——这是一个论坛,它的运作方式是问题应该公开解决,这样其他人也会从中受益。 2. 您应该发布您的代码 - 您尝试过哪些不起作用的方法?
-
首先,感谢您的建议。我再次编辑问题,请再次检查,谢谢。
标签: javascript html react-native