Picker UI

Posted by bruno.simoes7, Posted on September 1, 2011

0 votes

1
2
3
4
5
6
7
8
local picker = require("Picker")
local function onSelect( value ) 
   print("Selected value: " .. value) 
   return true
end
local types = {"char", "number", "number"}
local pp = { scale = 1.3, width = display.contentWidth }
picker.pickerFactory( "MyInstance", types, "D22", onSelect, pp)

Picker fully implemented with LUA. Find more @ Think-Techie


Replies

mediakube's picture
mediakube
User offline. Last seen 2 days 3 hours ago. Offline
Joined: 10 Sep 2010

Can the dimensions of the XUI picker be adjusted? I know the graphics would have to be modified to accommodate that, but that's not a big problem, I just wonder what part of the code controls it.

bruno.simoes7
User offline. Last seen 9 hours 15 min ago. Offline
Joined: 15 Mar 2011

You can re-scale it as illustrated in the example provided here and set the position you want (see method "createPickerMethodOne"). You can also change graphics in Picker.lua

The code was built on top of the demo "scroll list", which was not a good idea. But feel free to improve it. Source code is available at Google code.

Best Regards,
B

mediakube's picture
mediakube
User offline. Last seen 2 days 3 hours ago. Offline
Joined: 10 Sep 2010

Thanks for the prompt reply! :-)

mediakube's picture
mediakube
User offline. Last seen 2 days 3 hours ago. Offline
Joined: 10 Sep 2010

Bruno, I'm assuming this widget works the same on both iOS and Android?