문제

I made the Scrollable View in NGUI using following tutorials Here but how can I use button to scroll the objects. Like If i click on up button it ScrollView should be up and If i click on down ScrollView should be down.

Your help will be appreciated. Thanks.

enter image description here

도움이 되었습니까?

해결책 2

You can do two different things to have scrolling button, depending what do you mean.

  1. If you want to have a scroll button, you should create UIScrollBar component, which you will attach to you UIScrollView as a horizontal or vertical scroll bar. See NGUI examples included to the package.
  2. If you want to have a object on your list, which clicked will allow you to drag the UIScrollView, you should attach to this gameObject a UIDragScrollView component. It will allow you to drag-to-scroll behavior, similar to mobile list dragging experience. Again, such example should be included to the package.

EDIT: After your question clarification, the answer should be a bit different.

You should write a script, with a reference to your UIScrollView and then you should call on it MoveRelative( Vector3 relative ) or MoveAbsolute( Vector3 absolute ), which will move the scroll view.

다른 팁

I just figure out how to do this.

SpringPanel.Begin ( GameObject go,Vector3 pos,float strength ) 

here GameObject is NGUI gameObject such as ScrollView and pos is position what amount should scrollview move and strength is that related to speed. hope you will find useful.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top