I wish to add a customized UIView which may show GIF’s & Photos (AnimatedImageView UIView from KingFisher Library) on prime of the floating UITabBarItem.
iOS 26 launched a brand new behaviour the place on scrolling the UITabBar minimises or collapses and the floating UITabBarItem reduces in measurement as properly.
I’m able to add the customized UIView on the floating UITabBarItem when the UITabBar is in its common state however that it disappears when the UITabBar minimises. And the customized view is once more again when the UITabBar returns to its common state.
I’m utilizing the beneath code to 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 utilizing the beneath code
self.tabBar.gadgets?[4].view?.backgroundColor = .systemRed
Works as anticipated however disappears when the UITabBar minimises, which you’ll be able to see by way of the beneath video
There may be name for trait change when the brand new UITabBarAccessory
minimise, and I’m making an attempt to alter the background color to yellow but it surely by no means seems, you may see that yellow color seems when the UITabBar once more modifications to it is common state
I can confirm by way of the View Debugger that the interior UIView _UITabButton
modifications it is reminiscence tackle however by way of code I’m unable to entry the modified UIView even when I’m going digging by way of the personal sub views of UITabBar.
So can anybody give me tips on how can I obtain this ? As there are different apps on the App Retailer which do it.