Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Created February 4, 2020 12:21
Show Gist options
  • Save MotiurRahman/a5f4fe54aa0e2edd74856ae13cd73b59 to your computer and use it in GitHub Desktop.
Save MotiurRahman/a5f4fe54aa0e2edd74856ae13cd73b59 to your computer and use it in GitHub Desktop.
keyboard test
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
// Create a Button.
var aButton = Ti.UI.createButton({
title : 'Show',
height : "100",
width : "100",
color : "red"
});
var textArea = Ti.UI.createTextArea({
borderWidth : 2,
borderColor : '#bbb',
borderRadius : 2,
color : '#888',
font : {
fontSize : 20,
fontWeight : 'bold'
},
//keyboardType : Ti.UI.KEYBOARD_NUMBER_PAD,
returnKeyType : Titanium.UI.RETURNKEY_DONE,
textAlign : 'left',
width : Ti.UI.FILL,
height : 500,
});
var dialog = Ti.UI.createAlertDialog({
//message : 'The file has been deleted',
androidView : textArea,
ok : 'Okay',
title : 'Place your query'
});
// Listen for click events.
aButton.addEventListener('click', function() {
dialog.show();
});
// Add to the parent view.
win.add(aButton);
textArea.addEventListener('return', function(e) {
textArea.blur();
dialog.hide();
alert('Input was: ' + textArea.value);
});
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment