Skip to content

[iOS] Auto Resize chrome icons on iOS to make it more consistent with other platforms - TabBar - #29093

Merged
rmarinho merged 11 commits into
dotnet:net10.0from
kubaflo:AutoResizeIconsProperty
Jul 30, 2025
Merged

rmarinho merged 11 commits into
dotnet:net10.0from
kubaflo:AutoResizeIconsProperty

Conversation

@kubaflo

@kubaflo kubaflo commented Apr 20, 2025 •

Copy link
Copy Markdown
Contributor

Description of Change

Brfore After
Screen.Recording.2025-03-02.at.16.23.32.mov
Screen.Recording.2025-03-02.at.16.22.18.mov

Fixes #29091

@kubaflo kubaflo self-assigned this Apr 20, 2025
@kubaflo kubaflo added platform/ios area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-controls-tabbedpage TabbedPage labels Apr 20, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Apr 20, 2025
@kubaflo
kubaflo force-pushed the AutoResizeIconsProperty branch from 16e846e to a52a3d7 Compare April 21, 2025 22:34
@PureWeen PureWeen added this to the .NET 10.0-preview5 milestone Apr 29, 2025
@PureWeen PureWeen moved this from Todo to Changes Requested in MAUI SDK Ongoing May 20, 2025
@kubaflo
kubaflo changed the base branch from main to net10.0 June 19, 2025 22:59
@kubaflo
kubaflo force-pushed the AutoResizeIconsProperty branch from a52a3d7 to 5f7c63f Compare June 19, 2025 23:00
@kubaflo
kubaflo marked this pull request as ready for review June 19, 2025 23:13
@kubaflo
kubaflo requested a review from a team as a code owner June 19, 2025 23:13
@kubaflo
kubaflo requested review from Aguilex and jfversluis June 19, 2025 23:13
@PureWeen PureWeen added the p/0 Current heighest priority issues that we are targeting for a release. label Jun 20, 2025

@PureWeen PureWeen left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need new images for TabBarIconsShouldAutoscale

Also, by default we want your resizing code to run. This will be a behavior that users have to opt out of.

@dotnet dotnet deleted a comment from azure-pipelines Bot Jun 23, 2025
@dotnet dotnet deleted a comment from azure-pipelines Bot Jun 23, 2025
@dotnet dotnet deleted a comment from PureWeen Jun 23, 2025
@dotnet dotnet deleted a comment from azure-pipelines Bot Jun 23, 2025
@dotnet dotnet deleted a comment from jsuarezruiz Jun 23, 2025
@PureWeen PureWeen moved this from Changes Requested to Ready To Review in MAUI SDK Ongoing Jun 23, 2025
@PureWeen

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen removed this from the .NET 10.0-preview6 milestone Jul 3, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements automatic resizing of tab bar icons on iOS to improve consistency with other platforms. The feature automatically scales tab bar icons according to Apple's Human Interface Guidelines while preserving aspect ratios.

  • Adds AutoResizeTabBarImage method that applies platform-specific size constraints based on device traits
  • Updates both TabbedPage and Shell renderers to use the auto-resizing functionality
  • Includes trait collection change handling to update icon sizes when device orientation changes

Reviewed Changes

Copilot reviewed 13 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UIImageExtensions.cs Adds blank line (formatting only)
TabbedViewExtensions.cs Implements core auto-resize logic with Apple HIG size constants
TabbedRenderer.cs Integrates auto-resize into TabbedPage handler with trait change support
ShellSectionRenderer.cs Applies auto-resize to Shell section icons
ShellItemRenderer.cs Handles trait changes for Shell item icons
PublicAPI.Unshipped.txt Documents new public API surface
Test files Adds UI test cases for both TabbedPage and Shell scenarios
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.HostApp/Issues/Issue29091Shell.xaml:10

  • The test case UI is missing AutomationId elements. According to the coding guidelines, AutomationIds should be unique and present for test elements. The ContentPage should have an AutomationId like "Tab1" to match the test expectation in Issue29091Shell.cs.
                                <ContentPage IconImageSource="groceries.png"

@kubaflo
kubaflo force-pushed the AutoResizeIconsProperty branch from 5bdf658 to 80d0dbe Compare July 27, 2025 14:34
@dotnet dotnet deleted a comment from azure-pipelines Bot Jul 28, 2025
rmarinho
rmarinho previously approved these changes Jul 28, 2025
@jfversluis

Copy link
Copy Markdown
Member

Does this need new snapshots @kubaflo ?

@kubaflo

kubaflo commented Jul 29, 2025

Copy link
Copy Markdown
Contributor Author

@jfversluis it looks like Mac needed one. Fixed

@rmarinho

Copy link
Copy Markdown
Member

/azp run

@dotnet dotnet deleted a comment from azure-pipelines Bot Jul 29, 2025
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@dotnet dotnet deleted a comment from PureWeen Jul 29, 2025
@PureWeen

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-controls-tabbedpage TabbedPage community ✨ Community Contribution p/0 Current heighest priority issues that we are targeting for a release. platform/ios

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[iOS] Auto Resize chrome icons on iOS to make it more consistent with other platforms - TabBar

6 participants