Date and Time Spinner Sample

Crank Storyboard Designer samples and code snippets.

Moderator: jamiev

Date and Time Spinner Sample

Postby jamiev » Thu Jun 17, 2010 9:19 am

Hello Everyone,

Some of you have asked how to create a date and time type spinner in Storyboard. I've put together an example on how to go about that. Simply unzip the archive and import the gapp file into Storyboard.

If you have any questions or other sample requests, please post them here.


Date Spinner Archive
(382.59 KiB) Downloaded 1044 times
User avatar
Posts: 60
Joined: Wed Nov 04, 2009 2:14 pm

Re: Date and Time Spinner Sample

Postby jjny » Mon Oct 22, 2018 8:58 am


How would you go about to make this scrollable with only touch, but still with the steps?
Thank you,

Best regards,
Posts: 1
Joined: Mon Oct 22, 2018 8:52 am

Re: Date and Time Spinner Sample

Postby nschultz » Mon Oct 29, 2018 8:30 am

Hello Jiny,

If you were looking to use touch to interact with the scroller then you would have to do a few steps.

First you would need to enable scrolling on the table element. With scrolling enabled you will be able to drag and flick the table control, however you will notice that the table will not lock to cells when the scrolling is complete. To resolve this you can bind a gre.table.scroll_stop event to the table to snap to the closest cell when scrolling is complete. Use the scroll stop event to trigger a lua callback where you can calculate which cell is closest using the table grd_yoffset variable and cell count. When you've calculated your final value then trigger an animation to adjust the offset to the desired spot.

This should get the scrolling and snapping behaviour you are looking for.
Posts: 27
Joined: Fri Jul 17, 2015 1:51 pm

Return to Samples

Who is online

Users browsing this forum: No registered users and 1 guest