- Home /
Is it possible to drag UIImage out of ScrollRect?
I've create the UI that have a content in ScrollRect. I want to make this ScrollRect scrollable in the vertical axis and the content inside ScrollRect will draggable when I drag it out horizontally.
Basically it's like Hayday shop UI. Is it possible to do something like that in UI in Unity 4.6?
Hey Guys,
I am trying to tackle this problem at the moment. Did anyone ever come across a solution?
Answer by Jaroslav-Stehlik · Dec 23, 2014 at 03:27 PM
I want to resolve this too.
I tried to Stop Drag Event from propagating, but then it does not respond at all. Only the scrollrect responds to that event.
The 1st solution would be to tap and hold atleast a second item and then to drag it out. the 2nd solution is more robust but less universal which I incorporated in my game, it is to write your own scroll rect and detect if anyone is holding the scrollrect as usual without events. If you drag the image out of the scroll rect, the scroll rect stops scrolling and the item is dragging.
But I would love to hear a solution which would work with the new UI.
Answer by Xtro · Apr 13, 2017 at 07:56 PM
I think I found the solution: IInitializePotentialDragHandler
Here is an example: http://www.programmierstube.com/unity-4-6-ui-and-nested-scrollrect/
Your answer
![](https://koobas.hobune.stream/wayback/20220613171557im_/https://answers.unity.com/themes/thub/images/avi.jpg)