react-native-navigation的迁移库

app.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. tabBarButtonColor: '#ffffff',
  33. tabBarSelectedButtonColor: '#ff505c',
  34. tabFontFamily: 'BioRhyme-Bold',
  35. },
  36. appStyle: {
  37. tabBarBackgroundColor: '#003a66',
  38. navBarButtonColor: '#ffffff',
  39. tabBarButtonColor: '#ffffff',
  40. navBarTextColor: '#ffffff',
  41. tabBarSelectedButtonColor: '#ff505c',
  42. navigationBarColor: '#003a66',
  43. navBarBackgroundColor: '#003a66',
  44. statusBarColor: '#002b4c',
  45. tabFontFamily: 'BioRhyme-Bold',
  46. },
  47. drawer: {
  48. left: {
  49. screen: 'example.Types.Drawer'
  50. }
  51. }
  52. });