Created
December 3, 2012 01:11
-
-
Save reymundolopez/4191987 to your computer and use it in GitHub Desktop.
Titanium - How to hide a Picker/DatePicker emulating blur (lost focus)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To hide the picker clicking on any other section of the screen use the following code: | |
| var win = Ti.UI.createWindow(); | |
| var view = Ti.UI.createView({ | |
| bottom : 0 | |
| }); | |
| var picker = Ti.UI.createPicker({ | |
| bottom : 0, | |
| type:Ti.UI.PICKER_TYPE_DATE, | |
| minDate:new Date(1930,0,1), | |
| maxDate:new Date(), | |
| value:new Date(2012,1,1) | |
| }); | |
| view.addEventListener("click", function(e){ | |
| picker.hide(); | |
| win.remove(view); | |
| }); | |
| win.open(); | |
| win.add(view); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment