- Home /
How to expand scrollRect content without having normalized position snap back to 1 (ScrollJacking)
Hi, I have a scrollRect in which I can add/remove objects, but if I am at the bottom of the content i.e normalizedPosition = (0,0)
. It will snap back to the top of the normalizedPosition = (0,1)
How can i stop this from happening?
What I want to happen is, if the normalizedPosition is 0.5f
and I add a gameObject causing the scrollRect.content
to expand, I want the normalized position to not move, but still allow the content to expand.
I have tried doing something like:
currentPos = normalizedPosition;
normalizedPosition = currentPos;
which I am getting a currentPos
then applying currentPos
within an event. But this caused the scrollRect to snap to top and then snap back to position... obviously not ideal
I hope this makes sense.
Any help would be much appreciated, thanks.
For any one who stumbles across this. I have posted correct answer in http://answers.unity3d.com/questions/1190703/scrollrect-resetting-scroll-position-on-content-ch.html?childToView=1383985#answer-1383985
Your answer
Follow this Question
Related Questions
Help with finding normalized position of buttons in scroll rect? 0 Answers
Scroll content disappears after trying to scroll on Android, on different aspect ratio devices. 0 Answers
Disabling mouse wheel when user is scrolling ScrollView 3 Answers
Scroll Rect works with mouse wheel but not mouse drag? 2 Answers
How to solve event triggers blocking scrollview inputs in an inventory/menu? 2 Answers