Skip to main content

UIExtensions.EnsureItemVisibility

Declaration#

public static void EnsureItemVisibility(ScrollRect scrollRect, GameObject target)

Parameters#

NameDescription
scrollRectScrollRect containing item
targetItem to ensure is visible

Description#

Ensure an item is visible within a scroll rect by adjust scrollbar positions as needed

Usage#

Example
using NullSave.GDTK;using UnityEngine;using UnityEngine.UI;
public class Example : MonoBehaviour{
    public void ExampleMethod(ScrollRect scrollRect, GameObject selectedItem)    {        scrollRect.EnsureItemVisibility(selectedItem);    }
}