禁用 React-Native 文本输入选项 [英] Disable Options on React-Native Text Input
本文介绍了禁用 React-Native 文本输入选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为一个项目使用 TextInput,并希望禁用任何类型的文本选择或操作,例如(剪切/复制/粘贴/共享),如下面的屏幕截图所示.
I am using TextInput for a project and wanted to DISABLE any kind of text selection or actions like (cut/copy/paste/share) as shared in the screenshot below.
我在 react-native 官方文档中找不到任何内容
I am not able find anything in the react-native official documentation
推荐答案
你应该添加 2 个属性selectTextOnFocus
和 editable
You should add 2 attributes
selectTextOnFocus
and editable
例如:
<TextInput editable={false} selectTextOnFocus={false} />
这篇关于禁用 React-Native 文本输入选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文