Skip to content

Commit

Permalink
fix: transparent scroll edge apperance
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Nov 1, 2024
1 parent 03c59ce commit e3c9e92
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,21 @@ struct TabViewImpl: View {
}
}

@available(iOS 15.0, *)
private func configureAppearance(for appearanceType: String, appearance: UITabBarAppearance) -> UITabBarAppearance {
if (appearanceType == "transparent") {
return appearance
}

switch appearanceType {
case "opaque":
appearance.configureWithOpaqueBackground()
case "transparent":
appearance.configureWithTransparentBackground()
default:
appearance.configureWithDefaultBackground()
}

UITabBar.appearance().scrollEdgeAppearance = appearance

return appearance
}

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

private func updateTabBarAppearance(props: TabViewProps) {
var appearance = UITabBarAppearance()
appearance = configureAppearance(for: props.scrollEdgeAppearance ?? "", appearance: appearance)
appearance = configureAppearance(
inactiveTint: props.inactiveTintColor,
appearance: appearance
)


if #available(iOS 15.0, *) {
UITabBar.appearance().scrollEdgeAppearance = appearance
appearance = configureAppearance(for: props.scrollEdgeAppearance ?? "", appearance: appearance)

if props.translucent == false {
appearance.configureWithOpaqueBackground()
Expand Down

0 comments on commit e3c9e92

Please sign in to comment.