- Home /
Question by
thepunkoff · Jul 07, 2019 at 04:21 PM ·
scrollviewscrolling
ScrollRect autoscroll down
So, I want the console to automatically scroll down, when I add this message to it. If I use the bare "ScrollDown()" with a "ScrollDown" button - it's ok. But when I want to use it on "ImitateNotification" button click - it scrolls down, but then scrolls the distance of one message UP again. Maybe something wrong with the ScrollView settings?
...
imitateNotification.onClick.AddListener(() =>
{
var msg =
"\nNotification Recieved: \"debug\"\n" +
"Title: \"debug\"\n" +
"Body: \"debug\"\n" +
"Channel: \"debug\"\n";
debugConsole.text += msg;
ScrollDown();
});
void ScrollDown()
{
scrollRect.verticalNormalizedPosition = 0;
}
Comment
Your answer
Follow this Question
Related Questions
Moving a ScrollRect child via script to focus on some point. 0 Answers
Scrollbar touch sensitivity 0 Answers
How do I Make TextMeshPro InputField scroll through code? 0 Answers
[Solved] need help regarding autolayout in scrollrect 1 Answer
ScrollRect not working on mobile at certain resolution 0 Answers