0
我實現了一個堆棧導航如下:陣營導航堆棧導航後退按鈕造型的Android
const MainNav = StackNavigator({
notes: { screen: NotesScreen },
addNote: { screen: AddNoteScreen }
}, {
initialRouteName: 'notes'
});
現在,當我從我的NotesScreen
去我AddNoteScreen
我得到的返回箭頭預期。不過,我已經使用以下navigationOptions
稱呼我的頭爲AddNoteScreen
:
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
相同的樣式?
這是當前的問題的圖像:
StatusBar不起作用:/ –
對,發現我的項目版本還不支持。我解決了使用視圖和狀態欄高度的問題。感謝您指點我正確的方向! –