react-native-navigation的迁移库

app.js 1.6KB

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