-
Notifications
You must be signed in to change notification settings - Fork 1.9k
CollectionView programmatic SelectedItem and ScrollTo not working as expected on iOS #11179
Comments
Can you please attach a small project that demonstrates this issue? Thanks! |
I've attached a brief demo to show this problem. When the app launches, the app automatically attempts to select one cell at random. That selects the cell with the collection view, but it does not trigger the VisualStateManager to style the cell. If the user then clicks the Random button in the header, the app will run the same code again to select a cell at random. This time, it will trigger the VSM to update the display. Steps to Reproduce:
Edit: This seems to only happen on iOS. |
I have the same issue now too on iOS. This visual state manager is working perfectly fine on Android but not iOS @samhouts |
Not able to select item in Collection View. Please see the sample attached ! |
Any update? I'm guessing this will not be looked at having lower priority and the release of maui? |
Its broken in Maui too lol |
This issue has been moved from a ticket on Developer Community.
I have CollectionView binded to simple string array (like "One", "Two", "Three". "Four", Five").
Labels with these text are inside Frame object.
I need background color of Frame to be Blue if selected and LightBlue if not selected.
I'm using VisualStateManager to assign background colors to Frame.
On initiation of form I need to selected item "Four" programmatically and scrollTo this item.
This works properly for Android device.
But, on iPadOS 13.5.1 device I've got different behavior:
VisualState instructions are not applied to Frame object when item selected programmatically. It applies only when manually tapping items.
I made background of Frame transparent and saw that programmatically selected item was changed to default grey background color.
So, programmatical selection works, but but VisualStates were not applied.
Instruction ScrollTo(index, position: ScrollToPosition.MakeVisible, animate: false ) not working on first programmatical attempt. However it starts working when selecting(tappimg) items manulally.
This behavior is for any XamarinForms releases. At present I'm using XF 4.7.0.968.
Original Comments
Visual Studio Feedback System on 6/22/2020, 00:51 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
Reproduction
I've attached a brief demo to show this problem. When the app launches, the app automatically attempts to select one cell at random. That selects the cell with the collection view, but it does not trigger the VisualStateManager to style the cell. If the user then clicks the Random button in the header, the app will run the same code again to select a cell at random. This time, it will trigger the VSM to update the display.
Steps to Reproduce:
Edit: This seems to only happen on iOS.
CollectionViewBugDemo.zip
The text was updated successfully, but these errors were encountered: