2
如何添加我自己的標題組件,以便我可以在nav中添加圖像?react-navigation添加自定義標題
我設置我的標題這樣,我可以設置組件的權利和左,但如何添加一個居中的圖像到我的導航?
const headerStyle = {
paddingHorizontal: theme.metrics.mainPadding,
paddingTop: 2,
paddingBottom: 2,
backgroundColor: theme.colors.purple,
justifyContent: 'center',
};
const headerTitleStyle = {
textAlign: 'center',
alignSelf: 'stretch',
alignItems: 'center',
...theme.fontStyles.appBarTitle,
};
const headerRight = <Text>logo here</Text>;
const headerLeft = <Text>text here</Text>;
export default {
title,
headerStyle,
headerTitleStyle,
headerRight,
headerLeft,
};
謝謝,我如何添加一個頭,一旦我已經隱藏的默認嗎? – Bomber
使用'native-base',您可以在' ... '元素之間添加您的代碼。 –