Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. //stack.js
  2.  
  3. const AppNavigator = createStackNavigator(
  4. {
  5. DetailPage: DetailPage, //Screen A
  6. MainScreen: { . //Screen B
  7. screen: MainScreen,
  8. navigationOptions: {
  9. header: null
  10. }
  11. }
  12. {
  13. initialRouteName: "MainScreen"
  14. }
  15. }
  16.  
  17.  
  18. //MainScreen.js
  19.  
  20. <View style={{ flex: 1 }}>
  21. <TabScreen />
  22. </View>
  23.  
  24. //TabScreen.js
  25.  
  26. const TabScreen = createMaterialTopTabNavigator(
  27. {
  28. Home: { screen: HomeStack },
  29. // Videos: { screen: Videos },
  30. Videos: { screen: Videos },
  31. Shows: { screen: AllShows },
  32. Live: { screen: Live }
  33. }
  34. )'
  35.  
  36. import React, { Component } from "react";
  37. import { View, Text } from "react-native";
  38. import { createStackNavigator, createAppContainer } from "react-navigation";
  39. import { createMaterialBottomTabNavigator } from "react-navigation-material-bottom-tabs";
  40.  
  41. import Camera from "./screens/camera";
  42. import Welcome from "./screens/welcome";
  43.  
  44. import Scanner from "./screens/scanner";
  45. import Cards from ".//screens/cards";
  46.  
  47. const BottomNavigation = createMaterialBottomTabNavigator(
  48. {
  49. Scan: { screen: Scanner },
  50. Cards: { screen: Cards },
  51. Settings: { screen: Cards }
  52. },
  53. {
  54. initialRouteName: "Scan",
  55. shifting: true
  56. }
  57. );
  58. const AppNavigator = createStackNavigator({
  59. Welcome: {
  60. screen: Welcome,
  61. navigationOptions: { header: null }
  62. },
  63. Camera: {
  64. screen: Camera,
  65. navigationOptions: { header: null }
  66. },
  67. Home: {
  68. screen: BottomNavigation,
  69. navigationOptions: { header: null }
  70. }
  71. });
  72.  
  73. export default createAppContainer(AppNavigator);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement