Closed pfiggins closed 6 years ago
Just wanted to circle back and let you know that it's being caused by handling the ValueChanged event. If I take that handler off the event, everything is fine. So it must be some sort of timing issue. Either way, for now what I have found to work is to make the control invisible and then visible. This causes a redraw and the text is again centered as expected.
Will take a look.
I cannot reproduce this. Can you tell me device and OS?
This issue has been reported before. I even found a workaround once, but now even that does not work. Back to text being left aligned only happens on Android.
https://github.com/alexrainman/SegmentedControl/issues/59 https://github.com/alexrainman/SegmentedControl/issues/41 https://github.com/alexrainman/SegmentedControl/issues/30
EDIT: Suggestion from https://github.com/alexrainman/SegmentedControl/issues/30 about setting the RowDefinition height to 60 has worked for me now.
This is more a Xamarin.Forms issue than the control itself. Thats why setting the HeightRequest fix it.
So what is the best workaround then? Can you implement something in the control to ensure it redraws properly? I'm still seeing this on any redraw and it's pretty annoying to have to hook into any event that may cause a redraw and make sure I hide/show this control. No other controls have this issue, so either they work around it or it's something specific to how this control operates.
Oh, and sorry I missed your earlier request. I'm personally seeing this on Android with genymotion generic tablets running api 23 and 25. I haven't really paid attention to which physical tablets do/don't have the issue.
I have a strange issue where once tapped, my segmented control text becomes left aligned.
Before -
After -
Any ideas?