Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (keyboard)
Viewing all articles
Browse latest Browse all 352

Hiding Keyboard without using blur()

$
0
0

Hi,

I have allot of TextFields on my app on one of the screen. I want to hide the keyboard onClick anywhere outside TextField.

Currently, I have to do something like this...

function hideKeyboard() {
    $.fieldOne.blur();
    $.fieldTwo.blur();
    $.fieldThree.blur();
    $.fieldFour.blur();
    $.fieldFive.blur();
    $.fieldSix.blur();
    $.fieldSeven.blur();
    $.fieldEight.blur();
}
Is there a way to tell the iOS to hide the keyboard without going through every TextField and invoking the blur event on them?

Alternatively, Is there a way to get a "Collection" of controls on screen that you can iterate through and invoke blur() - allowing you to create as many textfield as you want without having to keep track of them?

e.g.

for (var i = 0; i < TextFields.length; i++) {
    TextFields[i].blur();
}

Viewing all articles
Browse latest Browse all 352

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>