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] Tab Selected Icon Color not changing if using Font icons - fix #22437

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented May 15, 2024

Description

In iOS development, UIImage.RenderingMode is an enumeration used to define how images are rendered when drawn on the screen. Here are the main rendering modes provided by UIImage:

.automatic:

  • This is the default mode. The system automatically determines how to render the image based on the context.
  • Typically, it will render template images in a way that they can adapt to different color styles, such as when used in navigation bars, tab bars, and buttons. If the image has an alpha channel, it may use a tint color.
  • If the image does not have an alpha channel or is not marked as a template image, it will render the original image.

.alwaysOriginal:

  • This mode renders the image as it is, without applying any modifications like tint color.
  • It's useful when you want to display the image in its original form, regardless of where it's used.
  • For example, if you have an icon with specific colors that you want to remain unchanged when placed in a button or tab bar, you should use .alwaysOriginal.

.alwaysTemplate:

  • This mode treats the image as a template, meaning that the image will be rendered using the tint color provided by the view it's displayed in.
  • It's commonly used for icons in toolbars, tab bars, or buttons where you want the icon to adopt the tint color of the control (e.g., to match the app's theme or user-selected appearance).
  • For example, if you set an image view's tintColor to red, an image with .alwaysTemplate will render in red.

Issues Fixed

Fixes #22032
Fixes #12250
Fixes #20866
Fixes #23174
Fixes #8244
Closes #24721

Before After
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-05-16.at.00.46.53.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-05-16.at.00.40.40.mp4

@kubaflo kubaflo requested a review from a team as a code owner May 15, 2024 22:47
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 15, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot May 20, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot May 20, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot May 20, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo kubaflo changed the title Tab Selected Icon Color not changing if using Font icons - fix [iOS] Tab Selected Icon Color not changing if using Font icons - fix Sep 1, 2024
@kubaflo kubaflo added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Sep 17, 2024
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit 4b8e604 into dotnet:main Sep 20, 2024
97 checks passed
@samhouts samhouts added the fixed-in-net8.0-nightly This may be available in a nightly release! label Sep 20, 2024
redducks100 pushed a commit to redducks100/maui that referenced this pull request Sep 24, 2024
…otnet#22437)

* Added a UITest (dotnet#22032)

* Fix dotnet#22032

* Added snapshots

* Updated test

* Fixed namespace

* Pending Android snapshot

* Update Issue22032.cs

* UI test improvements

---------

Co-authored-by: Javier Suárez <[email protected]>
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@samhouts samhouts added fixed-in-9.0.0-rc.2.24503.2 fixed-in-net8.0-nightly This may be available in a nightly release! and removed fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-controls-tabbedpage TabbedPage community ✨ Community Contribution fixed-in-9.0.0-rc.2.24503.2 fixed-in-net8.0-nightly This may be available in a nightly release! platform/iOS 🍎
Projects
None yet
4 participants