有没有办法为标签栏按钮设置自定义图标的高度和宽度?
谢谢!
search() {
return {
name: 'search',
screen: 'entry.Entry',
title: "Entry",
titleImage: true,
navigatorButtons: {
leftButtons: [{
id: 'back-button',
component: 'entry.BackButton'
}]
},
icon: require("./navigationAssets/searchIconInactive.png"),
selectedIcon: require(./navigationAssets/searchIconActive.png")
};
}
答案 0 :(得分:0)
你关注代码
static navigationOptions = {
tabBarLabel: 'Home',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: ({ tintColor }) => (
<Image
source={require('./chats-icon.png')}
style={[styles.icon, {tintColor: tintColor}]}
/>
),
};
参考此链接。 https://reactnavigation.org/docs/navigators/tab
我希望对你有所帮助