我可以在React Native中禁用View组件吗? [英] Can I disable a View component in react native?

查看:231
本文介绍了我可以在React Native中禁用View组件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序屏幕上有一个View组件,几乎没有文本输入.我无法禁用文本输入.有什么方法可以禁用完整的视图吗?

My app screen has a View component with few Text Inputs. I cannot disable text inputs. Is there a way that I can disable complete View?

P.S .:通过禁用View组件,我的意思是该组件可以渲染但对任何操作均不响应.

P.S.: By Disabling a View component I mean that the component renders but becomes unresponsive of any action.

推荐答案

您可以使用

You can use pointerEvents:

<View pointerEvents="none">
  ...
</View>

这将使视图对触摸事件无响应.

This will make the view unresponsive to touch events.

这篇关于我可以在React Native中禁用View组件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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