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

Open keyboard automatically, when window opens?

$
0
0

I can't figure out how to open the keyboard, when a window appears.

In some file (e.g. app.js):

var smallWin = Ti.UI.createWindow({
    url:'inputwindow.js'
});
smallWin.open();

The inputwindow.js:

var win = Ti.UI.currentWindow;
win.backgroundColor = '#fff';
win.opacity = 0.25;
 
var view = Ti.UI.createView({
    borderRadius: 10,
    backgroundColor: 'black',
    width: 250,
    height: 100,
    top:50
}); 
var label = Ti.UI.createLabel({
    left:10,
    top:10,
    text:"Name des Teams:",
    textAlign:'center',
    fontWeight:'bold'
});
var inputField = Ti.UI.createTextField({
    height: 40,
    width: 220,
    left:10,
    top: 40,
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
});
inputField.addEventListener('return', function(e) {
    win.close();
});
view.add(label);
view.add(inputField);   
win.add(view);
The keyboard appears, when I click into the textField, but it doesn't show up automatically.

Viewing all articles
Browse latest Browse all 352

Trending Articles



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