Closed Avery246813579 closed 6 years ago
Thanks for reporting. LayoutAnimation
is (was?) necessary to animate the shifting Bottom Navigation, when you have >= 4 Tabs. But I understand how this line could cause troubles, when two Layout changes happen at once.
Could you check if the shifting-Animation still works without this line?
Shifting-Animation does not work without the line. Maybe if we remove the line if shifting is off?
I'm at the moment rewriting big parts of the BottomNavigation. I will take a look at the LayoutAnimations, and will check how to call the LayoutAnimation without animating the whole screen.
Is it safe to fork and remove that line for now? As I only have 4 tabs for now.
Or should I try an if on shift being true (I assume there is some variable). I will mess around with it this weekend and see.
Yes, you can fork and remove that line for now. Implementing a fix would be a bit too much, since I'm currently doing the rewrite. v1.0.0 will fix that issue.
If anyone else needs the fork with the fix (only works for less than 4 tabs): https://github.com/hammadzz/react-native-material-bottom-navigation
thought I was going crazy when my tabs were suddenly doing this after updating to react-navigation 1.4. Glad to know my eyes aren't playing tricks on meπ
If anyone else is experiencing other issues please do share. I noticed that sometimes by changing tabs quickly or doing something (a trigger unknown at this time) it start making a large space in my last tab act like a button that will switch to the first tab whenever it is touched. Really strange. I don't know exactly how this is happening or what is triggering it. I didn't find anything in my code so far to see that I have any logic to navigate to the 1st tab there.
This issue will be fixed in the next version, see #76.
If you're interested in the solution: https://github.com/timomeh/react-native-material-bottom-navigation/blob/58b2b40d2b262a1118ad3a85a9f72c6c867a39ad/lib/ShiftingTab.js#L62-L70
Delaying the LayoutAnimation
call to the next frame won't cause other Layout changes to animate. (Or rather it will reduce the probability of glitches)
This issue will be closed when #76 is merged.
Closed with v1.0.0 β‘οΈ
What kind of Issue is this?
How are you using the Bottom Navigation?
Expected behavior
No animation to happen when switching tabs.
Actual behavior
For some reason iOS gets an annoying animation when switching tabs. Only happens on iOS.
Additional description and resources
I was actually able to fix this deleting the following from BottomNavigation.js
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
https://giphy.com/gifs/8TznS7ZN5Xek1trxO8
What did you do to find a solution?
I googled everywhere and didn't find anything.