import React, { useState } from 'react'; import {View , Text, TextInput, Button,StyleSheet} from 'react-native'; import { Icon } from 'react-native-elements' export default class Alignment extends React.Component { constructor(props) { super(props); } getStyle(i) { switch(i) { case 0: return 'flex-start' case 1: return 'center' case 2: return 'flex-end' case 3: return 'stretch' case 4: return 'space-around' case 5: return 'space-between' case 6: return 'baseline' } } set(i) { let style = { alignItems: this.getStyle(i) }; this.props.onSelect && this.props.onSelect(style) } justify(i) { let style = { justifyContent: this.getStyle(i) }; this.props.onSelect && this.props.onSelect(style) } alignSelf(i) { let style = { alignSelf: this.getStyle(i) }; this.props.onSelect && this.props.onSelect(style) } render() { let iconStyle = styles.iconStyle; return ([ this.set(0)}/> this.set(1)}/> this.set(2)}/> this.set(3)}/> , this.justify(0)}/> this.justify(1)}/> this.justify(2)}/> this.justify(4)}/> this.justify(5)}/> , this.alignSelf(0)}/> this.alignSelf(1)}/> this.alignSelf(2)}/> this.alignSelf(3)}/> this.alignSelf(6)}/> ] ); } } const styles = StyleSheet.create({ container:{ padding:10, flexDirection: 'row', justifyContent: 'space-around', borderBottomColor: '#B4B4B4', borderBottomWidth: 1 }, defaultInput: { marginTop:6, borderWidth:1, width:200 }, title: { }, iconStyle: { fontSize: 18, opacity: 0.6, cursor: 'pointer' } })