gpt4 book ai didi

android - TouchableOpacity 在绝对定位的 View 中不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:58:30 24 4
gpt4 key购买 nike

我有一个绝对定位的 View ,它包含三个 TouchableOpacity 组件,而这三个组件没有响应,它们根本不工作。这里出了什么问题?

代码

<View style={[styles.highNormalLowDocListHeaderStateContainer, {width: this.windowWidth, height: this.headerSmallHeight, position: 'absolute', left: 0, top: floatedHeaderTitleTop, elevation: 2}]}>
<TouchableOpacity onPress={() => this.getDocuments('high')} style={[styles.highNormalLowDocListHeaderStateTextContainer, highSelected.borderStyle]}>
<Text style={[styles.highNormalLowDocListHeaderStateText, highSelected.textStyle]}>HIGH</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.getDocuments('normal')} style={[styles.highNormalLowDocListHeaderStateTextContainer, normalSelected.borderStyle]}>
<Text style={[styles.highNormalLowDocListHeaderStateText, normalSelected.textStyle]}>NORMAL</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.getDocuments('low')} style={[styles.highNormalLowDocListHeaderStateTextContainer, lowSelected.borderStyle]}>
<Text style {[styles.highNormalLowDocListHeaderStateText, lowSelected.textStyle]}>LOW</Text>
</TouchableOpacity>
</View>

截图

enter image description here

最佳答案

看看你的导入。如果 import { TouchableOpacity } from 'react-native-gesture-handler'; 不起作用,您需要从 'react-native' 导入它。

关于android - TouchableOpacity 在绝对定位的 View 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39250449/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com