Version: 0.63

View Style Props

Example

import React from "react";
import { View, StyleSheet } from "react-native";
const ViewStyleProps = () => {
return (
<View style={styles.container}>
<View style={styles.top} />
<View style={styles.middle} />
<View style={styles.bottom} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "space-between",
backgroundColor: "#fff",
padding: 20,
margin: 10,
},
top: {
flex: 0.3,
backgroundColor: "grey",
borderWidth: 5,
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
middle: {
flex: 0.3,
backgroundColor: "beige",
borderWidth: 5,
},
bottom: {
flex: 0.3,
backgroundColor: "pink",
borderWidth: 5,
borderBottomLeftRadius: 20,
borderBottomRightRadius: 20,
},
});
export default ViewStyleProps;

Reference

Props

borderRightColor

TypeRequired
colorNo

backfaceVisibility

TypeRequired
enum('visible', 'hidden')No

borderBottomColor

TypeRequired
colorNo

borderBottomEndRadius

TypeRequired
numberNo

borderBottomLeftRadius

TypeRequired
numberNo

borderBottomRightRadius

TypeRequired
numberNo

borderBottomStartRadius

TypeRequired
numberNo

borderBottomWidth

TypeRequired
numberNo

borderColor

TypeRequired
colorNo

borderEndColor

TypeRequired
colorNo

borderLeftColor

TypeRequired
colorNo

borderLeftWidth

TypeRequired
numberNo

borderRadius

If the rounded border is not visible, try applying overflow: 'hidden' as well.

TypeRequired
numberNo

backgroundColor

TypeRequired
colorNo

borderRightWidth

TypeRequired
numberNo

borderStartColor

TypeRequired
colorNo

borderStyle

TypeRequired
enum('solid', 'dotted', 'dashed')No

borderTopColor

TypeRequired
colorNo

borderTopEndRadius

TypeRequired
numberNo

borderTopLeftRadius

TypeRequired
numberNo

borderTopRightRadius

TypeRequired
numberNo

borderTopStartRadius

TypeRequired
numberNo

borderTopWidth

TypeRequired
numberNo

borderWidth

TypeRequired
numberNo

opacity

TypeRequired
numberNo

elevation

(Android-only) Sets the elevation of a view, using Android's underlying elevation API. This adds a drop shadow to the item and affects z-order for overlapping views. Only supported on Android 5.0+, has no effect on earlier versions.

TypeRequiredPlatform
numberNoAndroid