fix(ios): tabview background color with appearance api in iOS 15+ (#9617)

This commit is contained in:
Janos Hrubos
2022-02-17 04:15:06 +01:00
committed by Nathan Walker
parent aa1c631e6f
commit 27492219e6

View File

@@ -571,7 +571,15 @@ export class TabView extends TabViewBase {
return this._ios.tabBar.barTintColor;
}
[tabBackgroundColorProperty.setNative](value: UIColor | Color) {
this._ios.tabBar.barTintColor = value instanceof Color ? value.ios : value;
if (majorVersion >= 15) {
let appearance = UITabBarAppearance.new();
appearance.backgroundColor = value instanceof Color ? value.ios : value;
this._ios.tabBar.scrollEdgeAppearance = appearance;
this._ios.tabBar.standardAppearance = appearance;
} else {
this._ios.tabBar.barTintColor = value instanceof Color ? value.ios : value;
}
}
[selectedTabTextColorProperty.getDefault](): UIColor {