- Home /
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?
Answer by karl_ · Apr 12, 2011 at 07:11 AM
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
Your answer
Follow this Question
Related Questions
Button Turns Off and On Object 1 Answer
Null reference exception[SOLVED] 1 Answer
GUI after pressed Destruction 2 Answers
Unable to move scrollbar 1 Answer
Putting Dictionary/List using foreach as buttons in a scroll view? 3 Answers