C # page scrolling like an iPhone?

How do you make horizontal scroll pages such as the iPhone menu? This is a touch screen application and I want to make some pages with buttons.

+4
source share
2 answers

Do not touch, but in general terms, handle the finger event, the finger move event, and the finger event. Calculate the speed on the display (distance / time - this can be done in units of absolute distance or in pixels). During a finger move event, scroll through the contents in step from the delta distance. After the finger event, quickly reduce the calculated speed and continue moving along the screen along the same axis as before the finger event. The degradation function is probably not linear for a more realistic effect. In addition, there should probably be an initial half-distribution of the estimated speed, otherwise you will end the menu scroll too far. Play with numbers and you will find a sweet spot.

+1
source

This is not a C # question, since the menu and user interface are really more connected with JavaScript and HTML if it lives on the server. Scrolling through pages, such as the iPhone menu, is a by-product of UIKit, which is a presentation layer similar to how HTML / JavaScript are presentation-level solutions.

I would probably start with this library and see if it suits your needs: http://www.jqtouch.com/

0
source

All Articles