在 React Native 中禁用 TextInput 的剪贴板 [英] Disable clipboard for TextInput in react native

查看:39
本文介绍了在 React Native 中禁用 TextInput 的剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以禁用 Textinput 的剪贴板,以便用户无法复制或粘贴文本.或者任何在本机反应中检测复制/粘贴剪贴板事件的方法.注意: caretHidden=true 和 contextMenuHidden=true 不能正常工作.

Is there any way to disable clipboard for Textinput so that user can not copy or paste text. Or any way to detect copy/paste clipboard event in react native. Note : caretHidden=true and contextMenuHidden=true are not working fine.

推荐答案

尝试清除该视图内的剪贴板.在 render()

Try clearing the clipboard inside that view. Add this inside render()

Clipboard.setString('');

编辑

Clipboard.setString('')} onSelectionChange={() =>Clipboard.setString('')}/>

这篇关于在 React Native 中禁用 TextInput 的剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆