【发布时间】:2019-09-07 17:26:16
【问题描述】:
当我使用TouchableOpacity 时,我的代码可以正常工作,但是当我使用TouchableWithoutFeedback 时,我的代码会引发错误。由于我不希望点击时出现这种模糊效果,因此我想改用 TouchableWithoutFeedback。
return (
<View style={{ ...props.style}}>
<TouchableWithoutFeedback style={{...styles.row }} onPress={toggleExpand}>
<Text style={{ fontFamily : 'wiproakkurat-bold' , fontSize : RFValue(14) , color : '#434343' , paddingLeft : RFValue(18), ...props.styleText ,}}>{props.title}</Text>
<Icon style={{paddingRight : RFValue(18)}} name={toggle.expanded ? 'keyboard-arrow-up' : 'keyboard-arrow-down'} size={RFValue(30)} color={'pink'} />
</TouchableWithoutFeedback>
<View style={styles.parentHr}/>
{
toggle.expanded &&
<View style={styles.child}>
{props.data}
</View>
}
</View>
)
【问题讨论】:
标签: react-native touchablewithoutfeedback