react-native-navigation的迁移库

app.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import React, {
  2. AppRegistry,
  3. Component,
  4. View
  5. } from 'react-native';
  6. import { Navigation } from 'react-native-navigation';
  7. // screen related book keeping
  8. import { registerScreens } from './screens';
  9. registerScreens();
  10. AppRegistry.registerComponent('App', () => App);
  11. export default class App extends React.Component {
  12. constructor(props) {
  13. super(props);
  14. }
  15. render() {
  16. return (
  17. <View />
  18. );
  19. }
  20. }
  21. // this will start our app
  22. Navigation.startTabBasedApp({
  23. tabs: [
  24. {
  25. label: 'One',
  26. screen: 'example.FirstTabScreen',
  27. icon: require('../img/one.png'),
  28. selectedIcon: require('../img/one_selected.png'),
  29. title: 'Screen One'
  30. },
  31. {
  32. label: 'Two',
  33. screen: 'example.SecondTabScreen',
  34. icon: require('../img/two.png'),
  35. selectedIcon: require('../img/two_selected.png'),
  36. title: 'Screen Two'
  37. },
  38. {
  39. label: 'Three',
  40. screen: 'example.ThirdTabScreen',
  41. icon: require('../img/three.png'),
  42. selectedIcon: require('../img/three_selected.png'),
  43. title: 'Screen Three',
  44. navigatorStyle: {
  45. navBarBackgroundColor: '#4dbce9',
  46. navBarTextColor: '#ffff00',
  47. navBarButtonColor: '#ffffff',
  48. statusBarTextColorScheme: 'light'
  49. }
  50. }
  51. ],
  52. // tabsStyle: {
  53. // tabBarButtonColor: '#ffff00',
  54. // tabBarSelectedButtonColor: '#ff9900',
  55. // tabBarBackgroundColor: '#551A8B'
  56. // },
  57. drawer: {
  58. left: {
  59. screen: 'example.SideMenu'
  60. }
  61. }
  62. });