Skip to content

[iOS] Fix for Slider ThumbImageSource is not centered properly on iOS 26#34019

Draft
HarishwaranVijayakumar wants to merge 3 commits intodotnet:mainfrom
HarishwaranVijayakumar:fix-33967
Draft

[iOS] Fix for Slider ThumbImageSource is not centered properly on iOS 26#34019
HarishwaranVijayakumar wants to merge 3 commits intodotnet:mainfrom
HarishwaranVijayakumar:fix-33967

Conversation

@HarishwaranVijayakumar
Copy link
Contributor

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

  • On iOS 26, when a custom ThumbImageSource is set on a Slider control at runtime, the thumb image is not vertically centered on the slider track. The image appears offset (positioned incorrectly).

Root Cause of the issue

  • On iOS 26, calling UISlider.SetThumbImage() at runtime no longer results in the thumb position being recalculated. On prior iOS versions, the position was recalculated automatically. The exact internal mechanism that changed is undocumented by Apple, but behavioral evidence confirms the regression: the thumb updates visually but remains at the stale position until user interaction forces a layout pass. Adding an explicit SetNeedsLayout() call restores correct behavior.

Description of Change

  • In SliderExtensions.cs, after calling SetThumbImage, the code now explicitly calls SetNeedsLayout() on the UISlider for iOS 26 and above to ensure the thumb position is recalculated, restoring previous runtime behavior.

Issues Fixed

Fixes #33967

Tested the behaviour in the following platforms

  • - Windows
  • - Android
  • - iOS
  • - Mac

Output

Before After

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Feb 12, 2026
@dotnet-policy-service
Copy link
Contributor

Hey there @@HarishwaranVijayakumar! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

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

Labels

area-controls-slider Slider community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS 26] Slider ThumbImageSource is not centered properly

2 participants