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

[V2][Android] Icon image in BottomTabs too small than iOS

Open dayaki opened this issue 7 years ago • 16 comments

Issue Description

The image used for bottomTabs appears smaller on Android than on iOS, iOS is displaying the ideal size of the image but on Android, it is way too small. How do I make the Android version look like the iOS version? see images below.

iOS

image

Android

image

Steps to Reproduce / Code Snippets / Screenshots

{
            stack: {
              children: [{ component: { name: "Friends" } }],
              options: {
                bottomTab: {
                  icon: require("./assets/img/friends-tab-icon.png"),
                  iconColor: "#878787",
                  selectedIconColor: "#00C040"
                }
              }
            }
          },
          { // The problematic icon
            stack: {
              children: [{ component: { name: "Map" } }],
              options: {
                bottomTab: {
                  icon: require("./assets/img/lens-tab-icon.png"),
                }
              }
            }
          },
          {
            stack: {
              children: [{ component: { name: "Notifications" } }],
              options: {
                bottomTab: {
                  icon: require("./assets/img/notification-tab-icon.png"),
                  iconColor: "#878787",
                  selectedIconColor: "#00C040"
                }
              }
            }
          }

Environment

  • React Native Navigation version: 2.18.5
  • React Native version: 0.59.8
  • Platform(s) (iOS, Android, or both?): Both
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator and Device

dayaki avatar May 15 '19 23:05 dayaki

We are having the same problem. Icon size in iOS is fine but Android always small. Even tried following the documentation and adding the icons natively, but didn't work. Did you find a workaround @dayaki ?

peresbri avatar May 21 '19 04:05 peresbri

@peresbri no workaround so far, just using it like that for now. You?

dayaki avatar Jun 10 '19 08:06 dayaki

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] avatar Jul 10 '19 10:07 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Jul 17 '19 10:07 stale[bot]

Why it is closed ? Have any one find any solution? . It would be appreciated

iparshantnagpal avatar Aug 27 '19 16:08 iparshantnagpal

Why it is closed ?. Any on find any solution ? It would be appreciated .

iparshantnagpal avatar Aug 27 '19 16:08 iparshantnagpal

+1 on this issue also. Should not be closed.

dooleyb1 avatar Sep 12 '19 22:09 dooleyb1

The icon on the far right below is perfectly sized on iOS (an image of 30x30 pixels). However, this is how it looks on Android.

Screenshot 2019-09-12 at 23 48 04

dooleyb1 avatar Sep 12 '19 22:09 dooleyb1

Please use 1x 2x 3 x images for handling this

ParshantArora avatar Sep 13 '19 02:09 ParshantArora

@ParshantArora I tried doing that but still having same issue

umkhan65 avatar Sep 26 '19 13:09 umkhan65

Just hide the tabs view( not remove) and create your custom tabbar component and use that .

ParshantArora avatar Sep 26 '19 13:09 ParshantArora

@ParshantArora icon: { uri: 'home_icon_bottom', scale: 0.1 // I have tried 1 and 3 too but still getting same size },

Still getting this Screen Shot 2019-09-26 at 7 58 58 PM

umkhan65 avatar Sep 26 '19 15:09 umkhan65

@umkhan65 scale: 0.1 is for ios only . Either use Custom tabs or use the following code

This piece controls opening my custom circle button component Navigation.showOverlay({ component: { name: 'common.AddIcon', passProps: {}, options: { statusBar: {}, overlay: { interceptTouchOutside: false, }, }, }, });

And the circle component: ... const StyledAddButtonContainer = styled(View)` position: absolute; justify-content: center; align-items: center; left: ${screenWidth / 2 - 35};

bottom: ${getBottomSpace() ? 30 : 0}; width: 70; height: 70; margin: auto; ; const AddIconContainer = styled(Animated.View) background-color: 'purple'; border-radius: 50; height: 70; width: 70; border-color: 'black'; border-width: 6; justify-content: center; align-items: center; `; ... render () { return ( <TouchableWithoutFeedback onPress={() => { console.log('my thing') }}> <AddIconContainer style={{ transform: [{ rotate }], }}> ) }

iparshantnagpal avatar Sep 26 '19 16:09 iparshantnagpal

@dayaki i am facing exactly same problem, did find any workaround ? Or anyone? React Native Navigation version: 4.0.4 React Native version: 0.61.5

barbarossusuz avatar Dec 24 '19 16:12 barbarossusuz

@barbarossusuz my issue was really stupid. I cropped the empty space in my png to the exact size of icon. It solved my issue

umkhan65 avatar Dec 27 '19 10:12 umkhan65

Did this ever get fixed as it's still occurring now. @guyca has this been reported before? Still happening in V6

flikQ avatar Apr 28 '20 12:04 flikQ