@@ -128,14 +128,18 @@ struct TabViewImpl: View {
128
128
}
129
129
. tag ( tabData? . key)
130
130
. tabBadge ( tabData? . badge)
131
- #if os(iOS)
132
131
. onAppear {
132
+ #if os(iOS)
133
133
guard index >= 4 ,
134
134
let key = tabData? . key,
135
135
props. selectedPage != key else { return }
136
136
onSelect ( key)
137
+ #endif
138
+ #if os(tvOS)
139
+ // TV needs this to correctly update appearance on first render
140
+ updateTabBarAppearance ( props: props, tabBar: tabBar)
141
+ #endif
137
142
}
138
- #endif
139
143
}
140
144
}
141
145
@@ -213,14 +217,20 @@ private func createFontAttributes(
213
217
return attributes
214
218
}
215
219
220
+ #if os(tvOS)
221
+ let tabBarDefaultFontSize : CGFloat = 30.0
222
+ #else
223
+ let tabBarDefaultFontSize : CGFloat = UIFont . smallSystemFontSize
224
+ #endif
225
+
216
226
private func configureTransparentAppearance( tabBar: UITabBar , props: TabViewProps ) {
217
227
tabBar. barTintColor = props. barTintColor
218
228
tabBar. isTranslucent = props. translucent
219
229
tabBar. unselectedItemTintColor = props. inactiveTintColor
220
230
221
231
guard let items = tabBar. items else { return }
222
232
223
- let fontSize = props. fontSize != nil ? CGFloat ( props. fontSize!) : UIFont . smallSystemFontSize
233
+ let fontSize = props. fontSize != nil ? CGFloat ( props. fontSize!) : tabBarDefaultFontSize
224
234
let attributes = createFontAttributes (
225
235
size: fontSize,
226
236
family: props. fontFamily,
@@ -247,7 +257,7 @@ private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps)
247
257
248
258
// Configure item appearance
249
259
let itemAppearance = UITabBarItemAppearance ( )
250
- let fontSize = props. fontSize != nil ? CGFloat ( props. fontSize!) : UIFont . smallSystemFontSize
260
+ let fontSize = props. fontSize != nil ? CGFloat ( props. fontSize!) : tabBarDefaultFontSize
251
261
252
262
let attributes = createFontAttributes (
253
263
size: fontSize,
0 commit comments