Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. //Exer04
  2.  
  3. constructor(props) {
  4. super(props);
  5. this.state = { Nome: "", Sobrenome: "", Idade: "" };
  6.  
  7. }
  8. render() {
  9. return (
  10. <View style={{ margin: 50, borderWidth: 8, padding: 10, borderColor: "#8cedc8", backgroundColor: "#f2e1c4" }}>
  11.  
  12. <View>
  13. <Text style={{ textAlign: "center", marginTop: 10, fontSize: 25, }}>Cadastro do cliente</Text>
  14.  
  15. <Text style={{ fontSize: 20, marginTop: 10, }}> Nome:</Text><TextInput style={{ borderBottomWidth: 1, fontSize: 30 }}
  16. onChangeText={(txt) => this.setState({ Nome: txt })}
  17. value={this.state.Nome}>
  18.  
  19. </TextInput>
  20. <Text style={{ fontSize: 20, }}> Sobrenome:</Text><TextInput style={{ borderBottomWidth: 1, fontSize: 30 }}
  21. onChangeText={(txt) => this.setState({ Sobrenome: txt })}
  22. value={this.state.Sobrenome}>
  23.  
  24. </TextInput>
  25. <Text style={{ fontSize: 20, }}>Idade:</Text><TextInput style={{ borderBottomWidth: 1, fontSize: 30 }}
  26. onChangeText={(txt) => this.setState({ Idade: txt })}
  27. value={this.state.Idade}>
  28.  
  29. </TextInput>
  30. </View>
  31.  
  32. <View style={{ marginLeft: 20, marginRight: 20, borderColor: "black", borderWidth: 2, marginTop: 20, }}>
  33.  
  34. <Button
  35. title="Enviar!"
  36. onPress={() => alert("Nome: " + this.state.Nome + "\n" + "Sobrenome: " + this.state.Sobrenome + "\n" + "Idade: " + this.state.Idade)}
  37. color="#8cedc8">
  38.  
  39. </Button>
  40. </View>
  41. <View style={{ marginLeft: 20, marginRight: 20, marginTop: 10, borderColor: "black", borderWidth: 2, }}>
  42. <Button
  43. title="Apagar"
  44. onPress={() => this.setState({ Nome: "", Sobrenome: "", Idade: "" })}
  45. color="#8cedc8">
  46. </Button>
  47. </View>
  48.  
  49.  
  50. </View>
  51.  
  52. );
  53. };
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement