Combined ScrollRects problem.

Hello,

we have a problem to combine 2 or more ScrollRect components together (http://shot.qip.ru/00NDav-3oHGoulTP/). If you slide to the left or rigt in the child Scroll Rect with a list in it we want to translate this movement to the MainScrollRect, but if you slide to the top or bottom in the childScrollRect it have to slide the list in it.

Is there a way to do that? How to translate the left/right drag action on the childScrollRect to the mainScrollRect?

Solved.

On childScrollRect:
void OnDrag(PointerEventData eventData)
{
mainScrollRect.content.anchoredPosition.x + eventData.delta.x
}

I think this is what you’re looking for:
https://bitbucket.org/ddreaper/unity-ui-extensions/src/c9354eadf4b9/Scripts/Utilities/ScrollRectEx.cs?at=develop_5.3

2 Likes

There is also the newly proposed ScrollConflictManager however I’ve not tested it’s full capabilities as yet. The author suggested it was made to handle such situations of nested scrollRects

DaveWill, thank you, its great :slight_smile:

SimonDarksideJ, realy good job, thank you for that :slight_smile: