Hey all,
Asked a while back to get some help and tried a few things and none of them are working. I honestly can’t believe something so simple is so complicated. All I am trying to do is scroll to the bottom of a ScrollView UI window after I add a new message, essentially just created the exact same look as any chat app or teting app. I’ve been banging my head against a wall for days and searching everywhere online, it simply refuses to scroll no matter what I try. So I am hoping someone knows how to make this happen!
I’ve got a ScrollView UI object, the Content child object has a Vertical Layout Group so everything gets stacked up properly. This part works fine, when I add a new message it shows up and appears under the previous message. The problem is when the stack of messages hits the bottom of the ScrollView. When I add more messages they just flow down, but the ScrollView will never scroll down to see them.
I’ve found a few pieces of code, but they do literally nothing and I don’t know what is wrong. I have tried this:
scrollRect.verticalNormalizedPosition = 0;
and it does nothing.
I tried:
Canvas.ForceUpdateCanvases();
scrollRect.content.GetComponent<VerticalLayoutGroup>().CalculateLayoutInputVertical() ;
scrollRect.content.GetComponent<ContentSizeFitter>().SetLayoutVertical() ;
scrollRect.verticalNormalizedPosition = 0
again, literally nothing.
I even tried putting these codes into the Update function just to make sure it wasn’t a problem with the timing. Still no movement of any kind.
I am really at a loss here and just pulling my hair out. Does anyone know anything about how to scroll to the bottom of a ScrollView? Or any good info for how to copy the type of messaging as in a chat app or texting app?