-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't render custom tab icon #1205
Comments
I couldn't reproduce it. The Can you post a full reproduction? What is |
images.js:
tabNavigator.js:
appNavigator:
|
Sorry didn't want to post full code because ive tried so much and couldn't
get any icon to display. Only thing ive been able to do is change label text
On 24 Apr 2017 5:27 PM, "Mike Grabowski" <notifications@github.com> wrote:
The NavigationPlayground example (https://github.com/react-
community/react-navigation/blob/master/examples/NavigationPlayground/js/
StacksInTabs.js#L110) works well without issues.
Can you post a full reproduction? What is learnColour? I suspect it's an
error with your Image.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1205 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKVVVf1n5H4d6Y3kBeYyrjMUtpxBNYhtks5rzL9tgaJpZM4NGUNr>
.
|
Make sure your I've run |
No the asset works fine, i've have used it many times, most recent being with
react-native-router-flux tabs.
…On 24 Apr 2017 7:55 PM, "Mike Grabowski" ***@***.***> wrote:
Make sure your <Image /> component works correctly by putting it in a
render method of any component. I believe this is an issue with your asset,
not with the tabBar itself?
I've run StacksInTabs example (NavigationPlayground) and added a custom
icon - it displays correctly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1205 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKVVVZ36zXdIfkjEPkZ1-dFuyAff71XQks5rzOIGgaJpZM4NGUNr>
.
|
Ok i must be doing something wrong then, i tried the StacksInTabs example but images still not showing.
|
I am also running into the same issue. |
i tried with v1.0.0-beta.6, still didn't work. |
@laclance taking your example, this: tabBarIcon: (
<Image style={{ width: 50, height: 50 }} source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}/>
), works as expected. Note |
Sorry, i left it out of comment (updated now) but I already tried adding styling, didn't make any difference. I just tried again with code above to double check and still no change. |
putting a console log in TabView.js shows tabBarOptions as undefined so default props get used. |
You should check console.logs in |
yeah i realized but _renderIcon is not getting called at all and TabBarComponent is TabBarTop() |
Do you have |
I did but i didn't put it into tabBarOptions :( thank you so much for the help guys. |
The StacksInTabs example does not have showIcon though. |
Add return in tabBarIcon: ({ tintColor })=>{ return ... }. It's work for me
------ or--
|
@satya164 Can we use tabBarOptions for customize tab icon, label and activeTintColor and label style in tabNavigationOptions for each component in between TabNavigator? My Code is Below which we try:
here activeBtnColor is dynamic for each component. Is it possible?? |
@laclance did you solve this issue? |
I got the same issue.
And I got this error (iOS 9.2 iphone6): https://i.imgur.com/4CqwTi6.png Something is weird because if I define it the same way in my screen like that:
It's working... |
Can i render a custom tab icon? i have tried everything but cant get it to show up.
sample code:
navigationOptions: { tabBarIcon: <Image source={learnColour}/> }
navigationOptions: { tabBarIcon: () => <Image source={learnColour}/> }
The text was updated successfully, but these errors were encountered: