[iOS 26] Fix Switch ThumbColor and OffColor not applied on initial load#35400
Conversation
|
Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
@SyedAbdulAzeemSF4852 would it make this one: #35385 not needed? |
@kubaflo , This PR is an enhancement to PR #33953 (already merged into inflight/current), which fixes ThumbColor reset on iOS/Mac Catalyst 26+ theme changes. This PR extends that same fix to also re-apply TrackColor in the deferred dispatch. PR #35385 takes a completely different approach. |
|
/review -b feature/regression-check -p ios |
1 similar comment
|
/review -b feature/regression-check -p ios |
|
/review -b feature/regression-check -p ios |
…net#34527) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details: Horizontalspacing / Verticalspacing is not not applied to the first column in GridItemLayout using CollectionView on Android platform. ### Root Cause: The grid spacing was not being distributed symmetrically across the active layout implementations, so edge items did not fully participate when spacing changed at runtime. ### Description of Change: - On Android, the fix in MauiRecyclerView.cs changes how RecyclerView padding is handled for GridItemsLayout. Android was already using SpacingItemDecoration, which applies half-spacing on all four sides of each item. Previously, negative RecyclerView padding canceled that spacing at the control edges. The branch keeps that negative-padding behavior for non-grid layouts, but disables it for GridItemsLayout, allowing the grid’s half-spacing to remain visible at the outer perimeter. This makes the first row and first column visually respond when spacing changes, but it also changes the grid behavior from spacing only between items to spacing around the outside edges as well. **Tested the behavior in the following platforms:** - [x] Android - [x] Windows - [ ] iOS - [ ] Mac ### Reference: N/A ### Issues Fixed: Fixes dotnet#34257 ### Screenshots | Before | After | |---------|--------| | <Video src="https://github.com/user-attachments/assets/578dda69-1d60-474c-a6d8-23b3f9d29a50" Width="300" Height="600"> | <Video src="https://github.com/user-attachments/assets/7f3826e6-5922-4b6f-a6b9-de581b7db6c3" Width="300" Height="600"> |
…atalyst navigated pages
688e2c3 to
21b4819
Compare
|
/review -b feature/regression-check -p ios |
|
/review -b feature/regression-check -p ios |
…oad (#35400) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - On iOS 26+, Switch colors are broken on initial load — OffColor is not applied at startup, and ThumbColor is never applied at all - After toggling and returning to initial state, OffColor appears but ThumbColor still doesn't apply. ### Root Cause - On iOS 26, Apple's "Liquid Glass" redesign introduces an internal UIKit styling pass that executes after MAUI's ConnectHandler completes, resetting UISwitch properties such as ThumbTintColor and the off-state track color back to system defaults. ### Description of Change - PR #33953 fixes ThumbColor not being applied correctly on iOS/MacCatalyst 26+ by deferring re-application via DispatchAsync after UIKit's styling pass. - This change enhances that fix to also re-apply TrackColor in the same deferred dispatch, since iOS 26's internal styling pass resets both ThumbTintColor and the off-state track color. The TrackColor re-application applies to both iOS and Mac Catalyst 26+, as both platforms exhibit this reset behavior. The method is also renamed from UpdateThumbColor to UpdateThumbAndTrackColor to accurately reflect that it now handles both colors. ### Issues Fixed Fixes #35257 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Before | After | |----------|----------| | <video src="https://github.com/user-attachments/assets/2ea7a96f-2adc-4381-af0e-3e57f161083a"> | <video src="https://github.com/user-attachments/assets/9ea09f9d-ebbf-48c6-92bc-3f393b42ba41"> | --------- Co-authored-by: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com>
…oad (#35400) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details - On iOS 26+, Switch colors are broken on initial load — OffColor is not applied at startup, and ThumbColor is never applied at all - After toggling and returning to initial state, OffColor appears but ThumbColor still doesn't apply. ### Root Cause - On iOS 26, Apple's "Liquid Glass" redesign introduces an internal UIKit styling pass that executes after MAUI's ConnectHandler completes, resetting UISwitch properties such as ThumbTintColor and the off-state track color back to system defaults. ### Description of Change - PR #33953 fixes ThumbColor not being applied correctly on iOS/MacCatalyst 26+ by deferring re-application via DispatchAsync after UIKit's styling pass. - This change enhances that fix to also re-apply TrackColor in the same deferred dispatch, since iOS 26's internal styling pass resets both ThumbTintColor and the off-state track color. The TrackColor re-application applies to both iOS and Mac Catalyst 26+, as both platforms exhibit this reset behavior. The method is also renamed from UpdateThumbColor to UpdateThumbAndTrackColor to accurately reflect that it now handles both colors. ### Issues Fixed Fixes #35257 ### Validated the behaviour in the following platforms - [ ] Windows - [ ] Android - [x] iOS - [x] Mac ### Output | Before | After | |----------|----------| | <video src="https://github.com/user-attachments/assets/2ea7a96f-2adc-4381-af0e-3e57f161083a"> | <video src="https://github.com/user-attachments/assets/9ea09f9d-ebbf-48c6-92bc-3f393b42ba41"> | --------- Co-authored-by: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
Root Cause
Description of Change
Issues Fixed
Fixes #35257
Validated the behaviour in the following platforms
Output
Before.mov
After.mov