【发布时间】:2018-03-11 07:30:31
【问题描述】:
我在按钮的样式中使用了边框半径,样式显示正确,但是,单击裁剪半径的区域仍然有效。
这是我的实现示例。
<View style={Style.userCircleContainerParent}>
<TouchableOpacity style={Style.userCircleContainer} onPress={() => this.onAvatarClick()}>
{this.props.state.pictureUrl
? <Image source={{uri: this.props.state.pictureUrl}} style={Style.userCircleImage} />
: <Image source={loadingImage} style={Style.userCircleImage} />}
</TouchableOpacity>
</View>
样式
userCircleContainerParent: {
alignSelf: 'center',
height: userIconSize,
width: userIconSize,
borderRadius: userIconSize / 2,
backgroundColor: 'white'
},
userCircleContainer: {
alignSelf: 'center',
height: userIconSize,
width: userIconSize,
borderRadius: userIconSize / 2,
backgroundColor: 'white'
},
userCircleImage: {
alignSelf: 'center',
height: userIconSize - 5,
width: userIconSize - 5,
marginTop: 2.5,
borderRadius: (userIconSize - 5) / 2,
backgroundColor: 'transparent'
},
【问题讨论】: