How to scroll to a specific element in ScrollRect with Unity UI?

后端 未结 10 2269
野的像风
野的像风 2021-02-12 04:03

I built a registration form for a mobile game using Unity 5.1. To do that, I use Unity UI components: ScrollRect + Autolayout (Vertical layout) + Text (labels)

10条回答
  •  星月不相逢
    2021-02-12 04:24

    Yes,this is possible using coding to scroll vertically, please try this code :

    //Set Scrollbar Value - For Displaying last message of content
    Canvas.ForceUpdateCanvases ();
    verticleScrollbar.value = 0f;
    Canvas.ForceUpdateCanvases ();
    

    This code working fine for me ,when i developed chat functionality.

提交回复
热议问题