gpt4 book ai didi

javascript - react native -有办法将箭头导航图标更改为菜单图标吗?

转载 作者:行者123 更新时间:2023-12-02 20:57:18 25 4
gpt4 key购买 nike

有办法隐藏标题中的右箭头吗?我需要将箭头图标更改为菜单图标,但我不明白该怎么做。

这是我的代码:

PrototypePointsScreen.navigationOptions = (navData) => {
return {
headerTitle: "pointing",
headerRight: () => (
<HeaderButtons HeaderButtonComponent={HeaderButton}>
<Item
title="home button"
iconName={Platform.OS === "android" ? "md-home" : "ios-home"}
onPress={() => {
navData.navigation.navigate("go");
}}
/>
</HeaderButtons>
),
};
};

最佳答案

您可以使用 navigationOptions 内的 headerBackImage 属性添加自定义后退按钮组件。为此,您必须从 react-native 导入 Image

import { Image } from 'react-native'

PrototypePointsScreen.navigationOptions = (navData) => {
return {
headerTitle: "pointing",
headerRight: () => (
<HeaderButtons HeaderButtonComponent={HeaderButton}>
<Item
title="home button",
headerBackImage: (
<Image source={require('../assets/icons/your-icon.png')} />
),
headerBackTitle: null,
iconName={Platform.OS === "android" ? "md-home" : "ios-home"}
onPress={() => {
navData.navigation.navigate("go");
}}
/>
</HeaderButtons>
),
};
};

关于javascript - react native -有办法将箭头导航图标更改为菜单图标吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61441603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com