How to hide Keyboard
Hi, I'm new to Titanium and i'm tryin to create a calculator app for my own use. The problem is, that none of the default apple keyboards have the buttons i need, so i'm trying to make a custom keyboard layout with single buttons. My Question is now, how can i hide the keyboard though I focus a textfield (to have this blinking bar which indicates a selected textfield). Its not working with blur cause then the bar disappears/field is not selected. How can i block the keyboard while still focusing the active textfield?
5 Answers
-
TextField.blur();
will hide the keyboard.Example below is an event listener for the DONE button. When the button is clicked, the keyboard disappears.
done.addEventListener('click',function(){
nameTxt.blur();
}); -
enabled: false
works for ioscheck this link
http://developer.appcelerator.com/question/128213/how-to-hide-the-keyboard-without-lose-focus-on-the-textfield
-
This guy here has an alternative approach. Check him out.
http://www.jonathanspies.com/posts/20-Picker-Fields-in-Titanium -
I need the same: In particular I need to be able to allow the text in a TextField to be copyable so that it can be pasted elsewhere. But the text is not to be editable, so the keyboard is not wanted/needed.
I think by setting the TextField.editable to false and .enabled to true should tell the keyboard not to pop up and allow other text functions (like copy / paste) to function.
-
Why not have a look in the Kitchen sink for an answer?
https://github.com/appcelerator/titanium_mobile/tree/master/demos/KitchenSink/Resources/examples