ger*_*eee 6 react-native touchableopacity
我有一个嵌套的 TouchableOpacity 组件,如下所示:
<View style={styles.mainTextContainer}>
<Text>
{mainText}
<TouchableOpacity
hitSlop={{top: Gutter, left: Gutter, bottom: Gutter, right: Gutter}}
style={styles.icon}
onPress={onPress}>
{mainTextIcon}
</TouchableOpacity>
</Text>
</View>
// These are the corresponding styles
icon: {
justifyContent: "center",
},
mainTextContainer: {
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "flex-start",
},
Run Code Online (Sandbox Code Playgroud)
但是, hitSlop 道具似乎不起作用。是因为它嵌套在文本组件内吗?
归档时间: |
|
查看次数: |
774 次 |
最近记录: |