Javascript 反应本机边界半径一角不圆
您好这是我正在使用的代码:Javascript 反应本机边界半径一角不圆,javascript,reactjs,react-native,Javascript,Reactjs,React Native,您好这是我正在使用的代码: menuItemButtonContainer: { marginRight: 1, marginLeft: 1, marginTop: 1, marginBottom: 1, paddingRight: 1, paddingLeft: 1, paddingTop: 1, paddingBottom: 1, borderRadius: 10, overflow: 'hidden',
menuItemButtonContainer: {
marginRight: 1,
marginLeft: 1,
marginTop: 1,
marginBottom: 1,
paddingRight: 1,
paddingLeft: 1,
paddingTop: 1,
paddingBottom: 1,
borderRadius: 10,
overflow: 'hidden',
position: "absolute",
backgroundColor: 'white',
borderWidth: 1,
borderColor: colors.navy
},
但由于某些原因,右上角不是圆的。我绞尽脑汁已经一天了
这是组件代码
<Native.View
style={[styles.menuItemButtonContainer, {width: 50, height: 30, marginLeft: 0}]}><Native.TouchableHighlight
underlayColor={colors.darkGray}
onPress={this.orderObjectChange.bind(this, 'ADD', item.id)}
style={{
justifyContent: 'center',
alignItems: 'center'
}}><Native.View><Components.Text
style={{color: colors.navy}}>ADD</Components.Text></Native.View></Native.TouchableHighlight></Native.View>
添加
你写的作品风格,请看下面。应用程序中的某些其他样式可能会覆盖边框样式。请检查该元素以查看
你写的作品风格,请看下面。应用程序中的某些其他样式可能会覆盖边框样式。请检查该元素以查看
按如下方式尝试每个角的边界半径:
menuItemButtonContainer: {
marginRight: 1,
marginLeft: 1,
marginTop: 1,
marginBottom: 1,
paddingRight: 1,
paddingLeft: 1,
paddingTop: 1,
paddingBottom: 1,
borderTopLeftRadius: 10, //Top Left Corner
borderTopRightRadius: 10,// Top Right Corner
borderBottomLeftRadius: 10,// Bottom Left Corner
borderBottomRightRadius: 10, // Bottom Right Corner
overflow: 'hidden',
position: "absolute",
backgroundColor: 'white',
borderWidth: 1,
borderColor: colors.navy
},
在每个拐角处尝试使用边界半径,如下所示:
menuItemButtonContainer: {
marginRight: 1,
marginLeft: 1,
marginTop: 1,
marginBottom: 1,
paddingRight: 1,
paddingLeft: 1,
paddingTop: 1,
paddingBottom: 1,
borderTopLeftRadius: 10, //Top Left Corner
borderTopRightRadius: 10,// Top Right Corner
borderBottomLeftRadius: 10,// Bottom Left Corner
borderBottomRightRadius: 10, // Bottom Right Corner
overflow: 'hidden',
position: "absolute",
backgroundColor: 'white',
borderWidth: 1,
borderColor: colors.navy
},
正如我已经检查了您的代码,并且根据该代码,您尝试使用下面的属性为所有的角点逐个指定角点半径
borderBottomLeftRadius: 10
borderBottomRightRadius: 10
borderTopLeftRadius: 10
borderTopRightRadius: 10
正如我已经检查了您的代码,并且根据该代码,您尝试使用下面的属性为所有的角点逐个指定角点半径
borderBottomLeftRadius: 10
borderBottomRightRadius: 10
borderTopLeftRadius: 10
borderTopRightRadius: 10
您是否也可以为组件提供代码?您是否可以检查该元素并查看对其应用了什么css?这应该会给你答案。另外,在你的应用程序中寻找你定义
borderRadius
的其他地方,看看这是否会对你的元素造成干扰。组件附件你也可以为组件提供代码吗?你能检查一下元素,看看它应用了什么css吗?这应该会给你答案。另外,在应用程序中查找您定义borderRadius
的其他位置,看看这是否会干扰您的元素。组件已连接