react-native-navigation的迁移库

options-title.mdx 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ---
  2. id: options-title
  3. title: Title Options
  4. sidebar_label: Title
  5. ---
  6. Controls the top bar title.
  7. ```js
  8. const options = {
  9. topBar: {
  10. title: {}
  11. }
  12. };
  13. ```
  14. ### `text`
  15. Set the title for the TopBar.
  16. | Type | Required | Platform |
  17. | ------ | -------- | -------- |
  18. | string | No | Both |
  19. ### `fontSize`
  20. Set the title font size. On Android this value is in `sp`.
  21. | Type | Required | Platform |
  22. | ------ | -------- | -------- |
  23. | number | No | Both |
  24. ### `color`
  25. Set the title color.
  26. | Type | Required | Platform |
  27. | ----- | -------- | -------- |
  28. | Color | No | Both |
  29. ### `fontFamily`
  30. Set the title font family.
  31. | Type | Required | Platform |
  32. | ---------- | -------- | -------- |
  33. | FontFamily | No | Both |
  34. ### `alignment`
  35. `fill` will make the title stretch and consume all available space in the TopBar while `center` will center the title in the middle of the TopBar.
  36. :::info defaults
  37. `center` is the default option on iOS while `fill` is the default for Android.
  38. :::
  39. | Type | Required | Platform |
  40. | --------------------- | -------- | -------- |
  41. | enum('center','fill') | No | Both |
  42. ### `component`
  43. Set a react [component](layout-component.mdx) as the title. If this option is specified then text is ignored.
  44. | Type | Required | Platform |
  45. | --------- | -------- | -------- |
  46. | [Component](layout-component.mdx) | No | Both |
  47. ### `topMargin`
  48. Change to TopBar's top margin.
  49. | Type | Required | Platform |
  50. | ------ | -------- | -------- |
  51. | number | No | Android |
  52. ### `visible`
  53. Determines whether the TopBar is visible or not.
  54. | Type | Required | Platform |
  55. | ------- | -------- | -------- |
  56. | boolean | No | Both |