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',您可以在' ... '元素之间添加您的代码。 –