react-native中是否存在大纲属性?

plupiseo  于 2022-11-17  发布在  React
关注(0)|答案(3)|浏览(176)

Outline属性在CSS中,但我尝试在react-native中使用outline属性。在react-native中使用outline属性时,我遇到以下消息。错误:outline属性不是有效的样式属性任何人都可以在react-native中知道css的属性而不是outline属性,而无需安装其他软件包。感谢您的合作。

ecbunoof

ecbunoof1#

在React Native中,我们不能通过使用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是它所理解的属性名称。

pobjuy32

pobjuy322#

searchInput: {
    width: "25rem",
    padding: 6,
    outlineColor: "green",
    outlineStyle: "solid",
    outlineWidth: 4,
    borderRadius:10,
    color:"#fff",
  }
wgmfuz8q

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"
    }}

相关问题