NavbarOptions.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { Platform } from 'react-native'
  2. import { TransitionPresets } from 'react-navigation-stack';
  3. const TITLE_OFFSET = Platform.OS === 'ios' ? 0 : 56;
  4. const NavigationOptions = {
  5. headerStyle: {
  6. backgroundColor: "#fff",
  7. borderBottomWidth: 1,
  8. borderBottomColor: '#f5f5f5',
  9. //fontColor: '#0d0610',
  10. elevation: 0,
  11. height: Platform.OS === 'ios' ? 80 : 50,
  12. },
  13. headerTintColor: '#333',
  14. headerTitleStyle: {
  15. fontWeight: 'normal',
  16. fontSize: 18,
  17. color: '#333',
  18. alignSelf:'center',
  19. textAlign: 'center',
  20. flex:1,
  21. marginTop: Platform.OS === 'ios' ? 10 : 0,
  22. },
  23. headerTitleContainerStyle:{
  24. left: TITLE_OFFSET,
  25. right: TITLE_OFFSET,
  26. },
  27. headerBackTitle: Platform.OS === 'ios' ? ' ' : null, // ~注意~ 这个地方是隐藏返回按钮文字的
  28. gestureEnabled: true,
  29. cardOverlayEnabled: true,
  30. gestureDirection: 'horizontal',
  31. ...TransitionPresets.SlideFromRightIOS,
  32. }
  33. export default NavigationOptions