alexrainman / SegmentedControl

MIT License
86 stars 38 forks source link

SegmentedControlOption are getting duplicated on android rotation (ViewCell inside a ListView) #23

Closed julesx closed 7 years ago

julesx commented 7 years ago

If you put a SegmentedControl into a ViewCell which is part of a ListView, and then rotate the device, the SegmentedControlOptions are once again added to the control, causing a duplication. Rotating the device again repeats the behavior indefinitely.

It seems like the OnElementChanged method is getting re-triggered incorrectly. There is no issue on iOS, only Android.

julesx commented 7 years ago

@alexrainman i hope we didn't scare you away. this is a great control.

alexrainman commented 7 years ago

@julesx not at all. I have been busy with work. I hope to have some time this week to work on this.

julesx commented 7 years ago

I'll add that it doesn't seem to be rotation specifically, but more the list view rows getting their size re-calculated. if i manipulate my listview by adding or removing other rows, the same duplication issue occurs

alexrainman commented 7 years ago

Hi there. I am back in business. I fixed all the issues less this one. Will try to reproduce.

alexrainman commented 7 years ago

I was able to fix it but the very first time text is aligned to left. Trying to solve that.

alexrainman commented 7 years ago

Solved.