react-native - 如果位置绝对,Touchablehighlight 不可点击

标签 react-native

我有一个 Touchablehighlight,我需要绝对定位,但在我这样做后它变得不可点击。

什么可能导致这种情况?如果我没有将位置设置为绝对,它的功能就像它应该的那样。

最佳答案

解决方案是更改组件的顺序。

我最初拥有的:

<TouchableHighLight><Text>Click me</Text></TouchableHighlight>
<View> .... </View>

这是修复:
<View>...</View>
<TouchableHighLight><Text>Click me</Text></TouchableHighlight>

关于react-native - 如果位置绝对,Touchablehighlight 不可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36938742/

相关文章:

react-native - 在react-native中设置环境变量?

android - react-native android fontFamily 不生效

react-native - FlatList 在 Android 上的 BottomSheet 中不起作用

javascript - 在没有 onChange 的情况下 react 文本表单字段

javascript - 如何在 react Hook 中正确更新状态

ios - iOS 上的 Expo 不断刷新我在 MacOS 上的 React Native 应用程序,这是由 Dropbox/iCloud 引起的

android - 与 nginx 的 SSL 套接字连接在某些 android 和 ios 设备上不起作用

ios - react native 错误 : Redefinition of RCTMethodInfo after installing the plugin

react-native - 为 Jest 模拟 Reactotron

android - react 导航 : How To Call Specific Function When User touches outside the Nav Drawer to Close it?