Outline属性在CSS中,但我尝试在react-native中使用outline属性。在react-native中使用outline属性时,我遇到以下消息。错误:outline属性不是有效的样式属性任何人都可以在react-native中知道css的属性而不是outline属性,而无需安装其他软件包。感谢您的合作。
ecbunoof1#
在React Native中,我们不能通过使用outline: "red 2px solid"来给予它,相反,我们需要将它分解为单独的样式。
outline: "red 2px solid"
const styles = StyleSheet.create({ button: { paddingHorizontal: 10, paddingVertical: 5, backgroundColor: "#e7622e", borderColor: "#fcfdfb", borderWidth: 2, outlineColor: "#523009", outlineStyle: "solid", outlineWidth: 4, }, title: { color: "white", }, });
outlineColor: "#523009", outlineStyle: "solid", outlineWidth: 4是它所理解的属性名称。
outlineColor: "#523009", outlineStyle: "solid", outlineWidth: 4
pobjuy322#
searchInput: { width: "25rem", padding: 6, outlineColor: "green", outlineStyle: "solid", outlineWidth: 4, borderRadius:10, color:"#fff", }
wgmfuz8q3#
style={{ height: 40, width: "95%", borderRadius: 20, backgroundColor: this.state.boxColor, marginHorizontal: 10, fontFamily: ConstantFontFamily.defaultFont, fontWeight: "bold", paddingLeft: 35, minWidth: Dimensions.get("window").width >= 1100 ? 630 : 393, outline: "none" }}
3条答案
按热度按时间ecbunoof1#
在React Native中,我们不能通过使用
outline: "red 2px solid"
来给予它,相反,我们需要将它分解为单独的样式。outlineColor: "#523009", outlineStyle: "solid", outlineWidth: 4
是它所理解的属性名称。pobjuy322#
wgmfuz8q3#