Advertisement
arickanjass

React Native Text Input Exercise

Dec 6th, 2018
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { StyleSheet, Text, View, TextInput } from 'react-native';
  3.  
  4. export default class App extends React.Component {
  5.   render() {
  6.     return (
  7.       <View style={styles.container}>
  8.         <Text>Username</Text>
  9.         <TextInput
  10.           style={styles.username}
  11.           placeholder="Username"
  12.         />
  13.         <Text>Password</Text>
  14.         <TextInput
  15.           style={styles.username}
  16.           placeholder="Password"
  17.         />
  18.       </View>
  19.     );
  20.   }
  21. }
  22.  
  23. const styles = StyleSheet.create({
  24.   container: {
  25.     flex: 1,
  26.     backgroundColor: '#7ed6df',
  27.     justifyContent: 'center',
  28.     padding: 10
  29.   },
  30.   username: {
  31.     width: '100%',
  32.     borderWidth: 1,
  33.     borderColor: 'black',
  34.     backgroundColor: '#fff',
  35.     padding: 5
  36.   }
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement