Search code examples
selectappceleratorelementappcelerator-titanium

Simple select element appcelerator


not sure if i am missing something obvious here but text fields show the keypad using Appcelerator, however there doesn't seem to be anything similar for select elements. you can use a picker but it doesn't function the same was as html select elements, ie the picker appears from the bottom and then disappears. I am having to use wriststrap at the moment to "fudge" this but it feels wrong.

Hopefully i am wrong and it is actually easy.

Thanks


Solution

  • Android and iOS Picker Controls are quite a bit different in terms of their UI. On Android they appear very much like a standard select list in HTML. iOS pickers have the "slot machine" look to them.

    Either one however can be placed at any position on the screen and do not animate from the bottom by default. If you include them within an View that animates then sure, but you can have them animate from anywhere or even just "pop" open in the center of the screen.

    Looking at the picker documentation, you can see how to implement one very easily. And it will look like this on the different platforms:

    enter image description here

    Android is actually a drop down (you can make it look like the spinner by using the useSpinner="true" property setting).

    So you have full control over the style and placement of these selection tools. If your trying to maintain UI consistency between the two platforms, standardizing on a more Android like approach on iOS, that requires a custom widget which you can create or using one from the community like your doing. A good resource for alternate options is below, but Tony Nuzzi's WristStrap is pretty great :)

    http://gitt.io/search?q=dropdown