Skip to content
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

[iOS] Support gradient colors for selected item in TabBarView #2107

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

mischreiber
Copy link
Contributor

@mischreiber mischreiber commented Nov 14, 2024

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

Added a new API to TabBarView, selectedItemGradient. This is an optional property of type CAGradientLayer? that, when set, will override the tab bar view's tint color. Instead, this gradient will be resized and used as a mask, giving the selected item a gradient fill.

Additionally, when this is set, the selected item's titleLabel will not receive any tinting.

Binary change

TBD

Verification

Verified the tint on iPhone and iPad, dark and light modes.

Visual Verification

GradientTabBar

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@mischreiber mischreiber requested a review from a team as a code owner November 14, 2024 21:37
@mischreiber mischreiber merged commit 8b6ed6d into microsoft:main Nov 14, 2024
7 checks passed
@mischreiber mischreiber deleted the GradientTabBar branch November 15, 2024 00:10
@joannaquu joannaquu mentioned this pull request Nov 21, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants