Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there outline property in react-native?

Outline property is in CSS,but i tried to use outline property in react-native. I encountered the following message while using outline property with react-native. error:outline property is not a valid style property Anyone know the property instead of outline property of css in react-native without install another package. Thanks for your cooperation.

like image 623
Author Avatar asked Nov 29 '18 04:11

Author


People also ask

How to make a solid outline in React Native?

In React Native we cannot give it by using outline: "red 2px solid" instead we need to break it into individual styles. Think of it as we are styling it through a javascript object.

What are props in React Native?

These created parameters are called props, short for properties. For example, one basic React Native component is the Image. When you create an image, you can use a prop named source to control what image it shows.

What is the difference between left and right flex in React Native?

When the direction is rtl, end is equivalent to left. This style takes precedence over the left and right styles. In React Native flex does not work the same way that it does in CSS. flex is a number rather than a string, and it works according to the Yoga layout engine.

What is overlay in React Native?

For conveying these messages, overlay is used. A view or a box with some content which floats above an app’s content is called overlay. Overlays are one of the easiest and effective way of informing the user or taking information from the user. React Native also provides an option to setup overlay in an app. …… props ……


1 Answers

In React Native we cannot give it by using outline: "red 2px solid" instead we need to break it into individual styles. Think of it as we are styling it through a javascript object.

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 are the property name that it understands.

like image 115
Amit Mondal Avatar answered Oct 19 '22 20:10

Amit Mondal