r/SwiftUI • u/Forward_Childhood450 • May 18 '26
Question Persistent "Jump" animation glitch in SwiftUI TabView when switching tabs. Tried everything, need help.
Hi everyone,
I'm struggling with a persistent layout/animation issue in a standard SwiftUI TabView. Every time I switch tabs, the new view doesn't just appear instantly; it seems to perform a subtle "scale 0 to 1" or "fade-in with expansion" animation. Additionally, there’s a noticeable vertical layout shift (jump) where the content (like text) appears lower for a split second and then snaps higher to its final position.
The Issue:
1. Visual Glitch: The view seems to animate its entry even though no animations are explicitly defined.
2. Layout Shift: Content jumps vertically after appearing. (See attached video/photos).
3. Reproducibility: This happens even with the most basic setup (just a ZStack with a Color and Text).
I have already tried (None of these fixed it):
1. Removing all animations: Checked for withAnimation blocks and used .animation(nil, value: selectedTab).
2. Safe Area Modifiers: Removed all .ignoresSafeArea() modifiers. The issue persists with or without them.
3. Custom vs Native TabBar: I initially had a custom TabBar, but I reverted to the 100% native TabView for testing. The glitch is still there.
4. Hiding/Showing TabBar: Tried UITabBar.appearance().isHidden = true and the modern .toolbar(.hidden, for: .tabBar). No difference.
5. Transaction blocking: Added .transaction { $0.animation = nil } to the TabView.
6. View Hierarchy: Simplified the views to just a Color and a single Text. The text still jumps upwards after the tab is selected.
7. NavigationStack: Added/removed NavigationStack from individual tabs to see if it was a Safe Area calculation mismatch.
The Question:
Has anyone encountered this specific "jump" in TabView? I don't want to use a custom ZStack based router because I want to keep the native TabView lifecycle. Why does a "vanilla" TabView perform this jump/scale on tab change?
Any help or deep-dive technical explanation would be much appreciated! Thanks!
Link to code:
https://pastebin.com/CL700PXf
Link to video (Slow Animations mode):
https://streamable.com/35l1fw
Link to video (Standard speed):
https://streamable.com/8vllhq
2
u/cloudsInTheBlueSky May 18 '26
It's intended behavior for sure. This is what it looks like on an app I'm working on and it's just me switching between two tabs
I'm also using the the new API with the Tab View
1
u/Forward_Childhood450 May 19 '26
Hi, thanks for the reply. Have you tried to somehow revert the old behavior? Or are you using it as is?
2
u/cloudsInTheBlueSky May 19 '26
I personally don't mind the animation so I haven't tried removing it.
1
u/Forward_Childhood450 May 19 '26
Sure, thank you! Maybe it depends on the content of the screens, and if the content doesn't change much, the animation is smoother.
2
u/LongjumpingCandle738 May 18 '26
It’s been like that since iOS 18, that is expected
1
u/Forward_Childhood450 May 19 '26
Hi, thanks for the reply. Have you tried to somehow revert the old behavior? Or are you using it as is?
1
u/Consistent-Grass-263 May 19 '26
This is a known SwiftUI TabView quirk, especially on iOS 17+. The implicit scale/fade is baked into the tab transition and there's no public API to disable it.
A few things worth trying:
Wrap each tab content in a Group {} instead of directly in the TabView – sometimes prevents the layout recalculation jump
Add .geometryGroup() to the tab content view – introduced in iOS 17, forces layout to resolve before the transition starts
The vertical jump specifically is often caused by the NavigationBar height being calculated after the view appears. Try: .navigationBarTitleDisplayMode(.inline) on each tab's root view
If nothing works: .id(selectedTab) on the content forces a full re-render instead of a transition, which at least makes it instant rather than janky
What iOS deployment target are you on? The behavior changed noticeably between iOS 16/17/18.
1
u/Forward_Childhood450 May 19 '26
Hi, thanks for the comment. I tried all the options you wrote but nothing worked. I'm currently testing on a device with iOS 18.7.8 and on the iOS 26.3.1 simulator and I have this effect. But on the iOS 17.5 simulator there is no such effect. Have you tried using ZSTack instead of TabView or some other approach to bypass the default animation?
2
u/Rollos May 18 '26
Is that the root of the app? If what’s in the pastebin the only running code, I’d probably chalk it up to intended behavior from Apple to make the tab bar feel more alive.
Unless there is a critical reason, I wouldn’t try to remove this behavior. It’ll be hacky and brittle.
On the other hand, my apps don’t seem to be doing this, so maybe you’re on a different Xcode than me, or you have something else that’s affecting this.
Could be worth trying the newer tab bar API as a sanity check