React Native 55.4:contextMenuHidden 不会在 Android 上隐藏菜单 - 禁用 React-Native 文本输入选项 [英] React Native 55.4: contextMenuHidden does not hide menu on Android - Disable Options on React-Native Text Input

查看:47
本文介绍了React Native 55.4:contextMenuHidden 不会在 Android 上隐藏菜单 - 禁用 React-Native 文本输入选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最近添加(在 v0.55.4 中)TextInput 的 prop 称为 contextMenuHidden.当我将此道具添加到 TextInput 组件时,它似乎禁用了 iOS 的复制和粘贴,但不适用于 Android.

I'm using a recently added (in v0.55.4) prop to TextInput called contextMenuHidden. When I add this prop to a TextInput component it seems to disable copy and paste for iOS but not for Android.

有没有其他人遇到过这种情况?是否还需要执行另一个步骤才能在 android 上禁用复制和粘贴?

Has anyone else experienced this? Is there another step that needs to happen to get this to disable copy and paste on android?

  <TextInput
    style={...}
    onChangeText={...}
    value={...}
    contextMenuHidden={true}
  />

推荐答案

for ios

<TextInput contextMenuHidden={true}

安卓版

<View removeClippedSubviews={true}>

  <TextInput contextMenuHidden={true} />

</View>

这篇关于React Native 55.4:contextMenuHidden 不会在 Android 上隐藏菜单 - 禁用 React-Native 文本输入选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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