Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. import React from 'react';
  2. import { StyleSheet, Text, View, FlatList, Image } from 'react-native';
  3. // import { bold } from 'ansi-colors';
  4.  
  5. export default class AboutUS extends React.Component {
  6. static navigationOptions = {
  7. title: 'Tentang Kami',
  8. }
  9. constructor(props){
  10. super(props);
  11. this.state={
  12. data:[
  13. {idn: "Nama : Kadek Marta Werdaya"},
  14. {idn: "NIM : 1715051131"},
  15. {idn: "Kelas : 4A" },
  16. ]
  17. };
  18. }
  19.  
  20. _renderItem = data => {
  21. return(
  22. <View>
  23. <Text style={styles.row}> {data.item.idn}</Text>
  24. </View>
  25. );
  26. };
  27.  
  28. render() {
  29. return (
  30. <View style={styles.container}>
  31. <View style={styles.foto}>
  32. <Image
  33. style={styles.gambar}
  34. source={require("./img/4x6.jpg")}
  35. />
  36. </View>
  37.  
  38. <View style={styles.identitas}>
  39. <FlatList
  40. data={this.state.data}
  41. renderItem={this._renderItem}
  42. keyExtractor={(item, index) => index.toString()}
  43. />
  44. </View>
  45. </View>
  46. );
  47. }
  48. }
  49.  
  50. const styles = StyleSheet.create({
  51. container: {
  52. flex: 1,
  53. backgroundColor: '#76ffff',
  54. flexDirection: 'row',
  55. },
  56.  
  57. row: {
  58. fontSize: 18,
  59. padding: 11,
  60. borderWidth: 1
  61. },
  62.  
  63. foto:{
  64. padding: 2,
  65. },
  66.  
  67. gambar:{
  68. width:100,
  69. height: 150,
  70. },
  71. identitas:{
  72. paddingTop: 4,
  73. },
  74. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement