Search Unity

Scrolling image gallery

Discussion in 'UGUI & TextMesh Pro' started by RoninDvlpr, May 24, 2019.

  1. RoninDvlpr

    RoninDvlpr

    Joined:
    Nov 2, 2018
    Posts:
    7
    Hi, awesome Unity pros! :)

    I need a scroll-able image gallery for android. The functionality should be like this:
    The gallery is scrolling when the user drags the gallery, but when an Image is tapped some other events should happen (a scene load).

    Right now I'm using UI Scroll view with the Grid layout for displaying numerous instances of UI Image prefab. It scrolls nicely, but only when I'm using the slider or clicking on the spaces between the images (i guess it counts as a click on "content" element of the Scroll view).
    The images themselves have an Event trigger on them that handles click events and calls the function I made for scene loading.

    What should I do to get the same scrolling functionality even when the dragging starts with the click/tap of an Image?
     

    Attached Files:

  2. RoninDvlpr

    RoninDvlpr

    Joined:
    Nov 2, 2018
    Posts:
    7
    Solved this issue already. Looks like the event trigger component have "intercepted" the click events. To detect click i used OnPointerClick instead, and it started to work just as i need.