x


scroll view in iphone

hi i have a scroll view for my iphone app, however i can only make it scroll by scrolling the bar on the side, how do i make it scroll when i swipe inside the view as well?

more ▼

asked Apr 12 '11 at 05:07 AM

james 6 gravatar image

james 6
132 32 34 41

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Not complete code, but something like this ought to work:

var touch = Input.touches[0];

if(touch.phase == TouchPhase.Moved)
    scrollPosition += touch.deltaPosition.y;

Edit: A very good tutorial / code for scrolling behavior by Bampf can be found here: http://www.mindthecube.com/blog/2010/09/adding-iphone-touches-to-unitygui-scrollview

And there's this here: http://answers.unity3d.com/questions/10116/any-examples-of-an-iphone-like-scrollview-using-unity-gui

more ▼

answered Apr 12 '11 at 07:11 AM

karl_ gravatar image

karl_
2.4k 41 53 70

thx a lot appreciate your help

Apr 13 '11 at 04:57 PM james 6
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3695
x3337
x62

asked: Apr 12 '11 at 05:07 AM

Seen: 4015 times

Last Updated: Apr 12 '11 at 05:07 AM