我已经实现了一个堆栈导航器,如下所示:
const MainNav = StackNavigator({
notes: { screen: NotesScreen },
addNote: { screen: AddNoteScreen }
}, {
initialRouteName: 'notes'
});
现在,当我从 myNotesScreen转到 my时,AddNoteScreen我得到了预期的后退箭头。但是,我已经为我的标题设置了样式以AddNoteScreen使用以下内容navigationOptions:
static navigationOptions = () => ({
title: 'Add a note',
headerStyle: {
height: Platform.OS === 'android' ? 54 + STATUS_BAR_HEIGHT : 54,
backgroundColor: '#2196F3'
},
headerTitleStyle: {
marginTop: Platform.OS === 'android' ? STATUS_BAR_HEIGHT : 0,
color: 'white'
}
})
现在headerTitleStyle不影响 Android 上的后退箭头。如何使 android 上的后退箭头采用与 相同的样式headerTitleStyle?
这是当前问题的图像:
