React Native Text is a React component for displaying text. Text supports nesting, styling, and touch handling. This component can be nested and it can inherit properties from parent to child. This can be useful in many ways.
Example
import React, {Component} from 'react'; import {View, Text, Image, StyleSheet} from 'react-native';
export default class TextExample extends Component { render() { return ( <View style={styles.container}> <View style={styles.header}> <Text>Text Component</Text> </View> <View style={styles.body}> <Text style={styles.text}> <Text style={styles.capitalLetter}>TEXT COMPONENT</Text>
<Text>The React NAtive Text Component</Text>
<Text> is used to <Text style={styles.wordBold}>Display </Text> text. </Text>
<Text style={styles.italicText}> We can apply different styles for Text with Style Props. </Text> </Text> <Text style={styles.textShadow}> This Is Out side text component with Italic and Shadow . </Text> </View> </View> ); } }
const styles = StyleSheet.create({ container: { backgroundColor: '#FAFAFA', flex: 1, }, header: { alignItems: 'center', padding: 10, backgroundColor: 'cyan', }, body: { backgroundColor: 'grey', padding: 16, flex: 1, }, text: { color: 'yellow', }, capitalLetter: { color: 'red', fontSize: 20, }, wordBold: { fontWeight: 'bold', color: 'black', }, italicText: { color: 'brown', fontStyle: 'italic', }, textShadow: { color: 'red', textShadowColor: 'white', textShadowOffset: {width: 2, height: 2}, textShadowRadius: 5, fontSize: 16, }, });
|
Output
Ruby program to add two integer numbers
how to create an array with Array.[](*args) in Ruby ?
What are the various Ruby runtimes, and how are they different?
Ruby program to check whether the given number is prime or not
Ruby program to reverse a string
Ruby program to check whether the given number is palindrome
Ruby program to print Fibonacci series
How to Replace array elements in Ruby?
Ruby program to print an array
Ruby program to check whether the given number is Armstrong
Program to Print Triangle of Numbers in Ruby
How to add/remove elements to Array in Ruby?
How to shuffle an array in Ruby?
Creating Array with Array.new(size, obj) in Ruby
Ruby program to generate random numbers
Ruby program to Calculate the factorial of given number
What are #method_missing and #send? Why are they useful?
How to Sort Array in Ruby?
How to get index of array element in Ruby
How to Get Input with Gets in Ruby
How to create two dimensional array in ruby?