when i add UIScrollView use code like this:
mScrollView = mPanel.gameObject.AddComponent<UICustomScrollView>();
mScrollView.movement = UIScrollView.Movement.Vertical;
mScrollView.verticalScrollBar = scrollBar;
i notice that in UIScrollView , when mPanel.gameObject.AddComponent<UICustomScrollView>() execute:
void OnEnable ()
{
list.Add(this);
if (Application.isPlaying)
{
if (horizontalScrollBar != null)
{
EventDelegate.Add(horizontalScrollBar.onChange, OnScrollBar);
horizontalScrollBar.alpha = ((showScrollBars == ShowCondition.Always) || shouldMoveHorizontally) ? 1f : 0f;
}
if (verticalScrollBar != null)
{
EventDelegate.Add(verticalScrollBar.onChange, OnScrollBar);
verticalScrollBar.alpha = ((showScrollBars == ShowCondition.Always) || shouldMoveVertically) ? 1f : 0f;
}
}
}
but when this the verticalScrollBar is null...
so i make a trick like this:
mScrollView = mPanel.gameObject.AddComponent<UICustomScrollView>();
mScrollView.movement = UIScrollView.Movement.Vertical;
mScrollView.verticalScrollBar = scrollBar;
[b]mScrollView.enabled = false;
mScrollView.enabled = true;[/b]
so this a bug? can i have some help ??
very thanks...