Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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:
alt text

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?

— asked April 21st 2010 by Sj Singh
0 Comments

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! ;)

    — answered November 19th 2010 by Paul Dowsett
    permalink
    0 Comments
  • Just specify the quantity of items you want to show.

    Taken from:
    http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.Picker-property-visibleItems

    visibleItems : 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

    — answered March 12th 2013 by mauricio flores
    permalink
    0 Comments
  • I'm looking to do the same thing. Can you explain how you rotated the picker?

    Thanks

    — answered November 19th 2010 by Arnaud Geyskens
    permalink
    0 Comments
  • — answered November 19th 2010 by Paul Dowsett
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.