react-navigation icon indicating copy to clipboard operation
react-navigation copied to clipboard

android the tabbar not show icon

Open ibmsoft opened this issue 9 years ago • 5 comments

the tabbar in android not show icon

i follow the example cd react-navigation npm install cd examples/NavigationPlayground npm install cd ../.. react-native start cd examples/NavigationPlayground react-native run-ios # ignore packager starting error react-native run-android # ignore packager starting error

the ios platform tabbar show the icon but the android not show icon

and i follow the doc on reactnavigation.org find hidden the header when use visible i use header:{visible:false} no effect on ios

ibmsoft avatar Feb 28 '17 14:02 ibmsoft

You have to set showIcon to true on Android, as it's false by default.

grabbou avatar Mar 01 '17 11:03 grabbou

Does this not work for TabBarBottom on Android?

AaronVasquez avatar Aug 08 '17 22:08 AaronVasquez

It works for on tab bar bottom this is my code:

in main.js

(showIcon: true is on the 3rd line)

                tabBarOptions: {
                  upperCaseLabel: false,
                  showIcon: true,
                  style: {
                    width: SCREEN_WIDTH,
                    backgroundColor: '#4586e0',
                  },
                  indicatorStyle: {
                    backgroundColor: 'white'
                  },
                  labelStyle: {
                    fontSize: 14,
                    color: "white",
                    fontFamily: "kohinoor"
                  },
                },
                tabBarPosition: 'bottom',
                swipeEnabled: false,
                animationEnabled: false,
                lazy: true
              })
            },

IN the component

   static navigationOptions = {
    header: null,
    title: "Contacts",
    tabBarIcon: () => {
      return <Icon name="person-pin-circle" size={25} color={"white"} />;
    }
  }

lucidtheory avatar Aug 19 '17 23:08 lucidtheory

@EsdrasEtrenne I need to display the footer images on tab navigator. How can I display it? I tried with Image source = {image.png} but it did not help yet.

Also, I have set showIcon: true, it also not working. Kindly provide your inputs

nihp avatar Mar 03 '18 05:03 nihp

I think you would need to update the tabBarIcon key in navigationOptions to return an image component with the correct image source. I have it set up to return an icon component above

lucidtheory avatar Mar 04 '18 07:03 lucidtheory