I need to add a customized UIView which might show GIFs and Pictures (AnimatedImageView UIView from KingFisher library) on prime of the floating UITabBarItem.
iOS 26 launched a behaviour the place on scrolling, the Liquid Glass UITabBar minimises or collapses and the floating UITabBarItem reduces in dimension as nicely. I’m able to add the customized UIView on the floating UITabBarItem when the UITabBar is in its common state nevertheless it disappears when the UITabBar minimises. And the customized view is once more again when the UITabBar returns to its common state.
How I entry the UIView property of floating UITabBarItem:
extension UIBarItem {
var view: UIView? {
return self.worth(forKey: "view") as? UIView
}
}
I added a background color to the floating UIBarItem:
self.tabBar.gadgets?[4].view?.backgroundColor = .systemRed
Works as anticipated however disappears when the UITabBar minimises:
There’s a name for trait change when the UITabBarAccessory
minimises and I’m attempting to alter the background color to yellow, nevertheless it by no means seems. You may see that yellow color seems when the UITabBar once more modifications to its common state. I can confirm by way of the View Debugger that the interior UIView _UITabButton
modifications its reminiscence tackle, however by way of code I’m unable to entry the modified UIView even by way of the non-public sub views of UITabBar.
The fifth UITabBarItem, how I can add a customized view on prime of it? Apple apps have completely used the fifth UITabBarItem for Search: