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

tabBarIcon : icon missing and Tab in Tab

Open alien3d opened this issue 9 years ago • 7 comments

First issue navigation problem.

Create a tab navigator top and bottom : work

Create a tab navigator in tab navigator : screen available but cannot be clicked topandbottom

Missing icon

  1. try to using react-vector-icons and put in tabBarIcon Result : not show
  2. Try to put same thing in view Resullt : show
  3. Try to add "showIcon:true" Result: not show
  4. Try to using normal require at the tabBarIcon Result :now show

Example gist for testing https://gist.github.com/alien3d/cf43e3b255d38b2c3042bbd183833e5a

** in few hour i will try the same thing in osx platform ..

software version
react-navigation 1.0.0-beta.11
react-native 0.46.4
node v6.11.0
npm or yarn 5.2.0
platform windows 7
platform mobile test android

alien3d avatar Aug 01 '17 09:08 alien3d

I have the same issue. Icon only renders on iOS phones, not on Android. Also, the tabs appear at the bottom of the screen on iOS, but at the the top on Android. What's going on?

rickcha avatar Aug 05 '17 00:08 rickcha

@rickcha default android are at top and ios at the bottom. unless you override it. What annoy me about ios , most framework developer e.g ratchet css,xamarin and here also follow standard https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/

alien3d avatar Aug 05 '17 03:08 alien3d

+1 same issue. The Icon tag worked in View but not TabBarIcon. Also there's no error thrown even when the "name" attribute was wrong like in the iOS case.

yarray avatar Aug 05 '17 05:08 yarray

Another finding: It seems that the tabBarComponent is TabBarTop even if the tabPosition is set to "bottom". After add { tabBarComponent: TabBarBottom } the icon displayed just as in the iOS case.

Further investigation showed that the showIcon switch in TabBarTop was always false even when setting { showIcon: true } when initializing TabNavigator, which should be the cause of this bug. I also tried to set showIcon to false with TabBarBottom but the icon still appeared so maybe the tabOptions was not passed in correctly?

yarray avatar Aug 05 '17 07:08 yarray

Silly me... The config should be { tabBarOptions: { showIcon: true } }. With this settings the tab icons can display icons correctly. It seems that it is a desired behavior instead of a bug.

yarray avatar Aug 05 '17 07:08 yarray

As re-read the doc at https://reactnavigation.org/docs/navigators/tab. @yarray thank you. but still i yet not yet solve the tab in tab navigaton..

alien3d avatar Aug 06 '17 06:08 alien3d

i solve it.. tab in tab issue.. some old duplicate issue check out again... but most of them no gist to follow up to check it out..

https://gist.github.com/alien3d/c8d9d1b3488bdc57d0bf06eb8d36e032

alien3d avatar Aug 06 '17 14:08 alien3d