【发布时间】:2015-10-02 17:22:42
【问题描述】:
我注意到将TouchableWithoutFeedback 替换为TouchableHighlight 或TouchableOpacity 会导致布局差异。这是预期的吗?
例子:
<TouchableWithoutFeedback onPress={this.onClick}>
<View style={styles.row_container}>
<Text style={styles.row_text}>
{'I count the number of taps: ' + this.state.clicks}
</Text>
</View>
</TouchableWithoutFeedback>
TouchableWithoutFeedback:
将其替换为TouchableOpacity:
样式是:
row_container: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
flex: 1,
height: 100,
borderColor: '#333333',
borderWidth: 1,
borderRadius: 5,
padding: 5,
},
row_text: {
flex: 1,
fontSize: 18,
alignSelf: 'center',
},
【问题讨论】:
标签: react-native