我想创建像IOS Map 这样的东西:
所以我创建了一个ScrollView,第一个元素是透明的 . 我的问题是,当我触摸ScrollView的第一个元素时,我想移动 Map . 所以我想在第一个元素上禁用触摸事件 . 这有可能吗?
我的伪代码:
<ScrollView
style={[styles.content, { width }]}
stickyHeaderIndices={[1]}
showsVerticalScrollIndicator={false}
>
<View style={styles.firstCell} pointerEvents="box-none"/>
<View style={{ backgroundColor: 'white' }}>
<Text>header</Text>
</View>
<Text>content</Text>
</ScrollView>
let styles = StyleSheet.create({
content: {
position: 'absolute',
top: 50,
bottom: 0,
},
firstCell: {
backgroundColor: 'transparent',
height: 500,
},
});