New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle tabview background color in iOS 15 #9617
fix: handle tabview background color in iOS 15 #9617
Conversation
I'll flag as needing additional changes to ensure it doesn't accidentally merge here. I think I'll turn to draft as well.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @janoshrubos this is looking pretty good - there's couple other things to consider - I will be posting a PR to ui-material-bottom-navigation to fix the same issue - we also want to ensure the appearance defaults are setup properly outside of only when background is set using the configure api's, for example:
https://developer.apple.com/documentation/uikit/uibarappearance/3197997-configurewithdefaultbackground
This ensures the same expected translucency effect is maintained as it was prior to ios 15.
That api will be used when no background is set and done via initNativeView for TabView here. Then if a background is set here it would then flip it's configuration to opaque:
https://developer.apple.com/documentation/uikit/uibarappearance/3197998-configurewithopaquebackground
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! thanks for the info @NathanWalker, it's much clearer now.
cfa65d6
into
NativeScript:release/8.2.0
PR Checklist
What is the current behavior?
In iOS15 the defined
tabBackgroundColor
for theTabView
only get's initialized correctly for a tab with scrolling content, but to get it initialized correctly you must have switched to another tab at least once before.What is the new behavior?
If there's a defined
tabBackgroundColor
it applies the color to a tab with and withoutScrollView
TODO: fix Nathan's change request ui-material-bottom-navigation
Fixes #9614