Created
December 14, 2017 05:27
-
-
Save rajivnarayana/2749921c38582ab4f872c31d810242aa to your computer and use it in GitHub Desktop.
A React native component to horizontally layout flexbox elements.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import { Text, View } from "react-native"; | |
class HelloWorldComponent extends Component { | |
render() { | |
return <View style={{ | |
flexDirection:"row", | |
backgroundColor : 'green', | |
justifyContent: 'space-around' | |
}}> | |
<Text style={{ backgroundColor:'red'}}>Float Left</Text> | |
<Text style={{}}>Center</Text> | |
<Text>Float Right</Text> | |
{/* <Text style={{ width:0, flexGrow: 1, backgroundColor:'yellow'}} numberOfLines={1} ellipsizeMode="middle">The quick brown fox jumped over the lazy dog.</Text> */} | |
</View> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment