locked
Get position of an element inside scrollview RRS feed

  • Question

  • User337790 posted

    Hi, all

    I am trying to achieve an event trigger when a certain element is in center of screen while scrolling from left to right or right to left, I tried scrollview but could not find any solution, some help will be highly appreciated.

    Thanks

    Tuesday, December 12, 2017 6:02 PM

All replies

  • User180523 posted

    If you can use a ListView instead... There is ItemAppearing and ItemDisappearing. That gets you the top and bottom items. The middle one is therefore just math, subtracting the index of the top from the index of the bottom.

    Tuesday, December 12, 2017 6:19 PM
  • User337790 posted

    @ClintStLaurent I tried this, but I was unable to manage height of listview with other elements, let me try to sort this out

    Tuesday, December 12, 2017 6:57 PM
  • User40646 posted

    @ClintStLaurent said: If you can use a ListView instead... There is ItemAppearing and ItemDisappearing. That gets you the top and bottom items. The middle one is therefore just math, subtracting the index of the top from the index of the bottom.

    Sup!

    This answer seems to be wrong. ItemAppearing and ItemDisapperaring are mean to be used to UI Virtualization, and nothing else. Those events are guarantee to fire at some point before item appear on screen (for ItemAppearing), and in some point after it disappear form screen ( for ItemDisapperaring), so there are not always good choice to keep good user experience flow.

    Monday, May 13, 2019 10:05 AM
  • User268349 posted

    del

    Monday, May 13, 2019 6:47 PM