【发布时间】:2019-08-07 23:20:49
【问题描述】:
我检查了以前的答案并尝试了不同的方法,但仍然无法正常工作。只有当我在屏幕内使用静态 navigationOptions 时它才有效
我尝试使用 defaultNavigationOptions 但不起作用,其上的 navigationOptions 也不起作用
TIMETABLE = createStackNavigator(
{
timetable: {
screen: timetable,
defaultNavigationOptions: {
title: i18n.t('TIMETABLE'),
headerStyle,
headerTitleStyle,
headerLeft: (
<Button
title="oi"
color="#fff"
/>
)
}
}
}
);
the above does not work and neither the below code:
TIMETABLE = createStackNavigator(
{
timetable: {
screen: timetable,
navigationOptions: {
title: i18n.t('TIMETABLE'),
headerStyle,
headerTitleStyle,
headerLeft: (
<Button
title="oi"
color="#fff"
/>
)
}
}
}
);
希望在堆栈导航器标题的左侧看到一个标题为“oi”的按钮,但没有出现任何按钮。
【问题讨论】:
标签: react-native react-navigation