【发布时间】:2021-03-07 19:06:34
【问题描述】:
在我的应用主屏幕中,我想自定义标题以使左右两个图标可以使用:
<HomeStack.Screen
name="Home"
component={HomeScreen}
options={{
title: '',
headerLeft: () => (
<View style={{ marginLeft: 10 }}>
<Icon.Button
name="ios-menu"
size={25}
color="#000000"
backgroundColor={COLORS.primary}
onPress={() => navigation.openDrawer()}
/>
</View>
),
headerRight: () => (
<View style={{ marginLeft: 10 }}>
<Icon.Button
name="location-outline"
size={25}
color="#000000"
backgroundColor={COLORS.primary}
onPress={() => navigation.openMap()}
/>
</View>
),
}} />
</HomeStack.Navigator>
我想添加其他内容,但要位于中心,这将根据我的需要进行定制,但我不知道如何实现它,因为没有任何东西叫做 headerCneter:
【问题讨论】:
标签: react-native react-native-navigation