Guest User

Untitled

a guest
Jan 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <TextInput
  2. textContentType="password"
  3. autoCapitalize="none"
  4. secureTextEntry={true}
  5. value={this.state.password}
  6. underlineColorAndroid="transparent"
  7. />
  8.  
  9. import React, {Component} from 'react';
  10. import {Modal, Text, TouchableHighlight, View, Alert} from
  11. 'react-native';
  12.  
  13. class ModalExample extends Component {
  14. state = {
  15. modalVisible: false,
  16. };
  17.  
  18. setModalVisible(visible) {
  19. this.setState({modalVisible: visible});
  20. }
  21.  
  22. render() {
  23. return (
  24. <View style={{marginTop: 22}}>
  25. <Modal
  26. animationType="slide"
  27. transparent={false}
  28. visible={this.state.modalVisible}
  29. onRequestClose={() => {
  30. Alert.alert('Modal has been closed.');
  31. }}>
  32. <View style={{marginTop: 22}}>
  33. <View>
  34. <TextInput
  35. textContentType="password"
  36. autoCapitalize="none"
  37. secureTextEntry={true}
  38. value={this.state.password}
  39. underlineColorAndroid="transparent"
  40. />
  41. </View>
  42. </View>
  43. </Modal>
  44.  
  45. <TouchableHighlight
  46. onPress={() => {
  47. this.setModalVisible(true);
  48. }}>
  49. <Text>Show Modal</Text>
  50. </TouchableHighlight>
  51. </View>
  52. ); }}
Add Comment
Please, Sign In to add comment