react-native-navigation的迁移库

app.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import {Platform} from 'react-native';
  2. import {Navigation} from 'react-native-navigation';
  3. import {registerScreens, registerScreenVisibilityListener} from './screens';
  4. // screen related book keeping
  5. registerScreens();
  6. registerScreenVisibilityListener();
  7. const tabs = [{
  8. label: 'Navigation',
  9. screen: 'example.Types',
  10. icon: require('../img/list.png'),
  11. title: 'Navigation Types',
  12. }, {
  13. label: 'Actions',
  14. screen: 'example.Actions',
  15. icon: require('../img/swap.png'),
  16. title: 'Navigation Actions',
  17. }];
  18. if (Platform.OS === 'android') {
  19. tabs.push({
  20. label: 'Transitions',
  21. screen: 'example.Transitions',
  22. icon: require('../img/transform.png'),
  23. title: 'Navigation Transitions',
  24. });
  25. }
  26. // this will start our app
  27. Navigation.startTabBasedApp({
  28. tabs,
  29. animationType: Platform.OS === 'ios' ? 'slide-down' : 'fade',
  30. tabsStyle: {
  31. tabBarBackgroundColor: '#003a66',
  32. navBarButtonColor: '#ffffff',
  33. tabBarButtonColor: '#ffffff',
  34. navBarTextColor: '#ffffff',
  35. tabBarSelectedButtonColor: '#ff505c',
  36. navigationBarColor: '#003a66',
  37. navBarBackgroundColor: '#003a66',
  38. statusBarColor: '#002b4c',
  39. tabFontFamily: 'BioRhyme-Bold',
  40. },
  41. appStyle: {
  42. tabBarBackgroundColor: '#003a66',
  43. navBarButtonColor: '#ffffff',
  44. tabBarButtonColor: '#ffffff',
  45. navBarTextColor: '#ffffff',
  46. tabBarSelectedButtonColor: '#ff505c',
  47. navigationBarColor: '#003a66',
  48. navBarBackgroundColor: '#003a66',
  49. statusBarColor: '#002b4c',
  50. tabFontFamily: 'BioRhyme-Bold',
  51. },
  52. drawer: {
  53. left: {
  54. screen: 'example.Types.Drawer'
  55. }
  56. }
  57. });