What function in react-native is used to make this type of two-sided text screen?

Viewed 18

I am new to react-native development and making screens for an Application but I am stuck at at point to make a screen with such two sided text.Kindly guide. Image attached Form Image

Thank You.

1 Answers

Hey you can do like this:

check here https://snack.expo.dev/G7jofLHad

enter image description here

import * as React from 'react';
import { Text, View, StyleSheet,FlatList } from 'react-native';
import Constants from 'expo-constants';

// You can import from local files
import AssetExample from './components/AssetExample';

// or any pure javascript modules available in npm
import { Card } from 'react-native-paper';

export default function App() {

  const renderItem = ({item}) => {
    return(
      <View style={{flex:1,justifyContent:'space-between',flexDirection:'row',marginVertical:5,
      marginHorizontal:5}} >
      <Text>Hey there</Text>
      <Text>Hey there</Text>
      </View>
    )
  }
  return (
    <View style={styles.container}>
      <FlatList
      data={[1,2,3,4,5,6]}
      renderItem={renderItem}
       />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingTop: Constants.statusBarHeight,
    backgroundColor: '#ecf0f1',
    padding: 8,
  },
  paragraph: {
    margin: 24,
    fontSize: 18,
    fontWeight: 'bold',
    textAlign: 'center',
  },
});

Related