views:

218

answers:

2

How do you make horizontal scrolling pages like the iPhone menu? It's for a touchscreen application and I want to make several pages with buttons.

A: 

This isn't a C# question as the menu and UI are really more related to JavaScript and HTML if this lives on a server. Scrolling pages and such like the iPhone menu are a byproduct of UIKit which is the presentation layer, similar to how HTML/JavaScript are presentation layer solutions.

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

Liam
It doesn't look to be about HTML pages so I am unsure about using HTML/JavaScript. The question specifically asked about a C# application.
Rangoric
Not all GUI applications are HTML/CSS/JavaScript.
BoltClock
The way I read it it seemed like it could have been HTML or WPF since there are devices that will still run a web browser.
Liam
+1  A: 

Have not done touch, but in general terms, handle finger down event, finger move event and finger up event. Calculate the speed across the display (distance / time -- this can be done in absolute distance units or pixels). During the finger move event, scroll the contents in step with the distance delta. After the finger up event, quickly decrease the calculated speed and continue to cause the display to scroll along the same axis as before the finger up event. The degredation function is probably not linear for more realistic effect. Also, there probably should be an initial half'ing of the calculated speed, otherwise you'll end of scrolling the menu too far. Play around with the numbers and you will find the sweet spot.

Ken