开发者

iPad Gestures with UITableView

I am using a UITableView to display a list of products in开发者_开发问答 an iPad app. I would like to make this list scroll up and down, not only by swiping the finger, but also buy flicking the iPad vertically downwards (to scroll down a bit) or upwards (to scroll up a bit). I don't know what this iPad gesture is called and how to implement it with a UITableView. Can someone please explain or provide me with some code/tutorial?

Thanks.


You need to use the accelerometer for that (it's not a gesture, a gesture in a movement on the screen with fingers).

Have a look at the UIAccelerometer doc, you will find some nice example for what you're trying to do :

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html#//apple_ref/doc/uid/TP40009541-CH4-SW5

Hope this helps, Vicent

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜