React Navigation 中 title 和 headerTitle 的区别
Difference between title and headerTitle in React Navigation
可能是个愚蠢的问题,但我无法弄清楚属性 title
和 headerTitle
之间的区别。我在文档中找不到任何有用的东西。
据我所知,headerTitle
将覆盖 title
(例如 here)
定义 headerTitle
时是否有设置 title
的原因?
headerTitle
通常用于提供一个自定义头组件 ...
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerTitle: props => <LogoTitle {...props} /> }}
/>
但是 title
用于更改纯文本...
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ title: 'My home' }}
/>
可能是个愚蠢的问题,但我无法弄清楚属性 title
和 headerTitle
之间的区别。我在文档中找不到任何有用的东西。
据我所知,headerTitle
将覆盖 title
(例如 here)
定义 headerTitle
时是否有设置 title
的原因?
headerTitle
通常用于提供一个自定义头组件 ...
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ headerTitle: props => <LogoTitle {...props} /> }}
/>
但是 title
用于更改纯文本...
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ title: 'My home' }}
/>