Skip to content

Commit e3c9e92

Browse files
committed
fix: transparent scroll edge apperance
1 parent 03c59ce commit e3c9e92

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ios/TabViewImpl.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,21 @@ struct TabViewImpl: View {
128128
}
129129
}
130130

131+
@available(iOS 15.0, *)
131132
private func configureAppearance(for appearanceType: String, appearance: UITabBarAppearance) -> UITabBarAppearance {
133+
if (appearanceType == "transparent") {
134+
return appearance
135+
}
136+
132137
switch appearanceType {
133138
case "opaque":
134139
appearance.configureWithOpaqueBackground()
135-
case "transparent":
136-
appearance.configureWithTransparentBackground()
137140
default:
138141
appearance.configureWithDefaultBackground()
139142
}
140143

144+
UITabBar.appearance().scrollEdgeAppearance = appearance
145+
141146
return appearance
142147
}
143148

@@ -159,14 +164,14 @@ private func configureAppearance(inactiveTint inactiveTintColor: UIColor?, appea
159164

160165
private func updateTabBarAppearance(props: TabViewProps) {
161166
var appearance = UITabBarAppearance()
162-
appearance = configureAppearance(for: props.scrollEdgeAppearance ?? "", appearance: appearance)
163167
appearance = configureAppearance(
164168
inactiveTint: props.inactiveTintColor,
165169
appearance: appearance
166170
)
167171

172+
168173
if #available(iOS 15.0, *) {
169-
UITabBar.appearance().scrollEdgeAppearance = appearance
174+
appearance = configureAppearance(for: props.scrollEdgeAppearance ?? "", appearance: appearance)
170175

171176
if props.translucent == false {
172177
appearance.configureWithOpaqueBackground()

0 commit comments

Comments
 (0)