我使用react-native-navigation在我的项目中创建导航,我需要放置图像而不是图标,这是我的代码
const startTabs = () => {
Navigation.startTabBasedApp({
tabs: [
{
screen: "awesome-places.Product",
label: "first Icon",
title: "first Icon",
icon: require("../../../images/006-coffee-cup.png")
},
{
screen: "awesome-places.Bag",
label: "Icon",
title: "Icon"
}
]
});
};
并且我需要保留图像的颜色,那么我该怎么做呢?
答案 0 :(得分:0)
我认为默认情况下,每个选中的图标的背景色也会改变, “更改所有非透明像素的颜色”
尝试添加具有相同图像的 selectedIcon :
const startTabs = () => {
Navigation.startTabBasedApp({
tabs: [
{
screen: "awesome-places.Product",
label: "first Icon",
title: "first Icon",
icon: require("../../../images/006-coffee-cup.png")
selectedIcon: require("../../../images/006-coffee-cup.png")
},
{
screen: "awesome-places.Bag",
label: "Icon",
title: "Icon"
}
]
});
};