Advertisement
enkf

Untitled

Jan 6th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { Button, Image, StyleSheet, ScrollView, View, Text, TouchableOpacity } from 'react-native';
  3. import { Icon } from 'react-native-elements';
  4. import { createAppContainer } from 'react-navigation';
  5. import { createBottomTabNavigator } from 'react-navigation-tabs';
  6. import A from './screen/Home';
  7. import b from './screen/Member';
  8. import C from './screen/Setting';
  9. import D from './screen/Booking';
  10.  
  11. // import D from './screen/Tabs4';
  12. // import E from './screen/Tabs5';
  13.  
  14. const App = createBottomTabNavigator(
  15. {
  16. Home: { screen: A},
  17. Account: { screen: b},
  18. Setting: { screen: C },
  19. // Booking: { screen: D}
  20.  
  21. // Tabs5: { screen: E},
  22. },
  23. {
  24. defaultNavigationOptions: ({ navigation }) => ({
  25.  
  26. tabBarIcon: ({ focused, horizontal, tintColor }) => {
  27. const { routeName } = navigation.state;
  28. if (routeName === 'Home') {
  29. return (
  30. // <Icon name="rowing" />
  31.  
  32. <Image
  33. source={
  34. focused
  35. ? require('./asset/images/home.png')
  36. : require('./asset/images/color/home.png')
  37. }
  38. style={{
  39. width: 30,
  40. height: 30,
  41. }}
  42. />
  43.  
  44. );
  45. } else if (routeName === 'Account') {
  46. return (
  47. <Image
  48. source={
  49. focused
  50. ? require('./asset/images/man-user.png')
  51. : require('./asset/images/color/user.png')
  52. }
  53. style={{
  54. width: 30,
  55. height: 30,
  56. }}
  57. />
  58. );
  59. } else if (routeName === 'Setting') {
  60. return (
  61. <Image
  62. source={
  63. focused
  64. ? require('./asset/images/setting.png')
  65. : require('./asset/images/color/settings.png')
  66. }
  67. style = {{
  68. width: 30,
  69. height: 30,
  70. }}
  71. />
  72. );
  73. } else if (routeName === 'Booking') {
  74.  
  75. }
  76. }
  77.  
  78.  
  79.  
  80. }),
  81.  
  82. tabBarOptions: {
  83. activeTintColor: '#fff',
  84. inactiveTintColor: 'white',
  85. style: {
  86. backgroundColor: '#E91E63',
  87. color: '#E91E63',
  88. fontWeight: 'bold',
  89. fontSize: 20,
  90. height: 70,
  91. // borderTopLeftRadius: 20,
  92. // borderTopRightRadius: 20,
  93. },
  94.  
  95. },
  96.  
  97. }
  98. );
  99. export default createAppContainer(App);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement