100% width in React Native Flexbox
You should use Dimensions
First, define Dimensions.
import { Dimensions } from "react-native";
var width = Dimensions.get('window').width; //full width
var height = Dimensions.get('window').height; //full height
then, change line1
style like below:
line1: {
backgroundColor: '#FDD7E4',
width: width,
},
Simply add alignSelf: "stretch"
to your item's stylesheet.
line1: {
backgroundColor: '#FDD7E4',
alignSelf: 'stretch',
textAlign: 'center',
},