Skip to content

mbender74/ti.keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ti.Keyboard for Appcelerator Titanium SDK 10.1.0.GA+

Because with Appcelerator Titanium you have to call the blur() function on a specific Ti.UI.TextField or Ti.UI.TextArea element, it can be a bit difficult and over-complicated to keep track of the latest active element where the virtual keyboard has been triggered from and call manually blur() on it in order to hide any virtual keyboard.

This helps to hide any visible/active keyboard from anywhere for iOS and Android.

Example

var win = Ti.UI.createWindow({
	backgroundColor : 'white'
});
var textfield = Ti.UI.createTextField({
	hintText : "Text"
});
win.add(textfield);
win.open();

var button = Ti.UI.createButton({
	title : "Hide",
	top : 10
});
button.addEventListener("click", function() {
	var keyboard = require('ti.keyboard');
	keyboard.hide();
});
win.add(button);