@@ -115,9 +115,16 @@ struct TabViewImpl: View {
115115
116116#if !os(macOS)
117117 private func updateTabBarImages( props: TabViewProps , tabBar: UITabBar ? ) {
118- guard let tabBar, let items = tabBar. items else { return }
118+ guard shouldApplyLiquidGlassTintWorkaround ( ) ,
119+ let tabBar,
120+ let items = tabBar. items else { return }
121+
119122 configureTabBarItemImages ( items: items, props: props)
120- configureTabBarItemImagesAfterLayout ( tabBar: tabBar, props: props)
123+
124+ DispatchQueue . main. async { [ weak tabBar] in
125+ guard let tabBar, let items = tabBar. items else { return }
126+ configureTabBarItemImages ( items: items, props: props)
127+ }
121128 }
122129
123130 private func updateTabBarAppearance( props: TabViewProps , tabBar: UITabBar ? ) {
@@ -219,13 +226,12 @@ struct TabViewImpl: View {
219226 let tabActiveColor = tabData. activeTintColor ?? props. activeTintColor
220227 let assetIcon = props. icons [ itemIndex]
221228 let icon = assetIcon ?? makeSFSymbolImage ( named: tabData. sfSymbol)
229+ let shouldRenderLabelIntoImage = props. labeled && tabData. role != . search && icon != nil
222230
223- if shouldRenderTabBarLabelsIntoImages ( ) ,
224- props. labeled,
225- tabData. role != . search,
226- let icon {
231+ item. accessibilityLabel = tabData. title
232+
233+ if shouldRenderLabelIntoImage, let icon {
227234 item. title = " "
228- item. accessibilityLabel = tabData. title
229235 item. titlePositionAdjustment = UIOffset ( horizontal: 0 , vertical: 100 )
230236 item. image = makeTabBarItemImage (
231237 icon: icon,
@@ -242,6 +248,9 @@ struct TabViewImpl: View {
242248 continue
243249 }
244250
251+ item. title = props. labeled ? tabData. title : nil
252+ item. titlePositionAdjustment = UIOffset ( horizontal: 0 , vertical: 0 )
253+
245254 if let icon {
246255 item. image = props. inactiveTintColor. map {
247256 icon. withTintColor ( $0, renderingMode: . alwaysOriginal)
@@ -269,15 +278,6 @@ struct TabViewImpl: View {
269278 return UIImage ( systemName: sfSymbol)
270279 }
271280
272- private func configureTabBarItemImagesAfterLayout( tabBar: UITabBar , props: TabViewProps ) {
273- guard shouldRenderTabBarLabelsIntoImages ( ) else { return }
274-
275- DispatchQueue . main. async { [ weak tabBar] in
276- guard let tabBar, let items = tabBar. items else { return }
277- configureTabBarItemImages ( items: items, props: props)
278- }
279- }
280-
281281 private func selectedAttributes( props: TabViewProps ) -> [ NSAttributedString . Key : Any ] {
282282 TabBarFontSize . createFontAttributes (
283283 size: props. fontSize. map ( CGFloat . init) ?? TabBarFontSize . defaultSize,
@@ -287,9 +287,14 @@ struct TabViewImpl: View {
287287 )
288288 }
289289
290- private func shouldRenderTabBarLabelsIntoImages( ) -> Bool {
291- let version = ProcessInfo . processInfo. operatingSystemVersion
292- return version. majorVersion >= 26
290+ private func shouldApplyLiquidGlassTintWorkaround( ) -> Bool {
291+ #if os(iOS)
292+ if #available( iOS 26 . 0 , * ) {
293+ return true
294+ }
295+ #endif
296+
297+ return false
293298 }
294299
295300 private func makeTabBarItemImage(
@@ -427,6 +432,9 @@ extension View {
427432 . onChange ( of: props. iconsRevision) { _ in
428433 updateTabBarImages ( props: props, tabBar: tabBar)
429434 }
435+ . onChange ( of: props. labeled) { _ in
436+ updateTabBarImages ( props: props, tabBar: tabBar)
437+ }
430438 . onChange ( of: props. fontSize) { _ in
431439 updateTabBarAppearance ( props: props, tabBar: tabBar)
432440 updateTabBarImages ( props: props, tabBar: tabBar)
0 commit comments