Stretch a control.
I'm trying to create a horizontal sliding menu effect with the picker by rotating it 90 degrees. It works fine but I can't figure out how to expand the picker from left to right.
This is the result:
I tried picker.height and picker.width with no luck. Is there a way to do this in view, zoom into a control or expand it somehow?
4 Answers
-
I am not sure this is possible, Arnaud.
Alternatively, though, you could possibly give a similar illusion by creating a small tableView (3 rows?) with each picker option being in a separate row of the table. Then create a similar picker graphic image of the picker fascia with a transparent part in the centre where the rows show through (or break the image up into 4 parts to leave a gap) and add it over the table.
I hope you see what I mean. I don't think it's as complicated as it sounds! ;)
-
Just specify the quantity of items you want to show.
Taken from:
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Picker-property-visibleItemsvisibleItems : Number
Number of visible rows to display. This is only applicable to a plain picker and when the useSpinner is true.
The spinner-style Android picker shows 5 rows by default; one selected in the middle and 2 above and below. Set to an odd number to ensure the selected row is in the middle.
Default: 5 -
I'm looking to do the same thing. Can you explain how you rotated the picker?
Thanks
-