Advertisement
enkf

Untitled

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