Advertisement
zidniryi

bottom cool

Jan 10th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. import React from 'react';
  2. import {StyleSheet, Text, View,Button} from 'react-native';
  3. import { createAppContainer} from 'react-navigation';
  4. import { createBottomTabNavigator } from 'react-navigation-tabs';
  5. import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
  6. import Icon from 'react-native-vector-icons/Ionicons';
  7. class HomeScreen extends React.Component {
  8. render() {
  9. return (
  10. <View style={styles.container}>
  11. <Text>Home Screen</Text>
  12. </View>
  13. );
  14. }
  15. }
  16. class ProfileScreen extends React.Component {
  17. render() {
  18. return (
  19. <View style={styles.container}>
  20. <Text>Profile Screen</Text>
  21. </View>
  22. );
  23. }
  24. }
  25. class ImageScreen extends React.Component {
  26. render() {
  27. return (
  28. <View style={styles.container}>
  29. <Text>Image Screen</Text>
  30. </View>
  31. );
  32. }
  33. }
  34. class CartScreen extends React.Component {
  35. render() {
  36. return (
  37. <View style={styles.container}>
  38. <Text>Cart Screen</Text>
  39. </View>
  40. );
  41. }
  42. }
  43. const styles = StyleSheet.create({
  44. container: {
  45. flex: 1,
  46. justifyContent: 'center',
  47. alignItems: 'center'
  48. },
  49. });
  50. const TabNavigator = createMaterialBottomTabNavigator(
  51. {
  52. Home: { screen: HomeScreen,
  53. navigationOptions:{
  54. tabBarLabel:'Home',
  55. tabBarIcon: ({ tintColor }) => (
  56. <View>
  57. <Icon style={[{color: tintColor}]} size={25} name={'ios-home'}/>
  58. </View>),
  59. }
  60. },
  61. Profile: { screen: ProfileScreen,
  62. navigationOptions:{
  63. tabBarLabel:'Profile',
  64. tabBarIcon: ({ tintColor }) => (
  65. <View>
  66. <Icon style={[{color: tintColor}]} size={25} name={'ios-cart'}/>
  67. </View>),
  68. activeColor: '#FFFFFF',
  69. inactiveColor: '#000',
  70. barStyle: { backgroundColor: '#c56cf0' },
  71. }
  72. },
  73. Image: { screen: ImageScreen,
  74. navigationOptions:{
  75. tabBarLabel:'History',
  76. tabBarIcon: ({ tintColor }) => (
  77. <View>
  78. <Icon style={[{color: tintColor}]} size={25} name={'ios-images'}/>
  79. </View>),
  80. activeColor: '#fff',
  81. inactiveColor: '#000',
  82. barStyle: { backgroundColor: '#ff3838' },
  83. }
  84. },
  85. Cart: {
  86. screen: CartScreen,
  87. navigationOptions:{
  88. tabBarLabel:'Cart',
  89. tabBarIcon: ({ tintColor }) => (
  90. <View>
  91. <Icon style={[{color: tintColor}]} size={25} name={'ios-person'}/>
  92. </View>),
  93. activeColor: '#fff',
  94. inactiveColor: '#000',
  95. barStyle: { backgroundColor: '#2ecc71' },
  96. }
  97. },
  98. },
  99. {
  100. initialRouteName: "Home",
  101. activeColor: '#fff',
  102. inactiveColor: '#000',
  103. barStyle: { backgroundColor: '#17c0eb' },
  104. },
  105. );
  106.  
  107. export default createAppContainer(TabNavigator);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement