Answers for "align text vertical center in react native"

1

vertical align center react native view

container :{
   justifyContent: 'center', //Centered vertically
   alignItems: 'center', // Centered horizontally
   flex:1
}
Posted by: Guest on February-11-2021
1

vertically center text react native

import React, { Component } from 'react';
import { Platform, StyleSheet, View, Text, } from 'react-native';

export default class App extends Component {

  render() {

    return (
      <View style={styles.container}>
        <Text style={styles.headerText}>Welcome to skptricks.com</Text>
      </View>
    );
  }
}


const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  },
  headerText: {
    fontSize: 20,
    textAlign: "center",
    margin: 10,
    fontWeight: "bold"
  },
  
});
Posted by: Guest on September-24-2021

Code answers related to "align text vertical center in react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language