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

Keyboard Resize the window size

$
0
0

Hi all if have a login page when the keyboard focus on username it auto resizes my page that is okay for me.when i press done button on keyboard it hides the keyboard.The problem is when it hides it is taking very few secs to do that operation in a mean while i can see part of my previous window details.Please help to find a solution here is my xml and js files.

xml

<Alloy>
    <Window id="mainwin">
<TextField id="Email" hintText="Email/Username"></TextField>
                <TextField id='Password' hintText="Password" passwordMask="true" onReturn="closeKeyboard"></TextField>
</Window>
</Alloy>
js
function closeKeyboard(keybord) {
        keybord.source.blur();
    }
 
 
    $.mainwin.open({
        animated : false
    });
tss file
"#mainwin[platform=ios]":{
    backgroundColor: "#fff",
    top: 20,
    navBarHidden: true,
    layout: "vertical",
    height: "100%",
    modal: true,
    orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
},
"#mainwin[platform=android]":{
    backgroundColor: "#fff",
    navBarHidden: true,
    layout: "vertical",
    modal: true,
    windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_PAN,
    orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]
},
"#Email":{
    top: "5%",
    color: "#000",
    height: "8%",
    width: '50%',
    font:{
        fontSize: Alloy.Globals.smallfont,
        fontFamily: 'Ubuntu-C'
    },
    paddingLeft: 5,
    borderRadius: 5,
    autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
    softKeyboardOnFocus: Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS,
    keyboardType: Ti.UI.KEYBOARD_EMAIL
},
"#Email[platform=ios]":{
    top: "5%",
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    color: "#000",
    height: "8%",
    paddingLeft: 5,
    width: '50%',
    font:{
        fontSize: Alloy.Globals.smallfont,
        fontFamily: 'Ubuntu-C'
    },
    borderColor: "#101518",
    borderWidth: 0.5,
    borderRadius: 5,
    autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
    keyboardType: Ti.UI.KEYBOARD_EMAIL
},
"#Password":{
    top: "2%",
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    color: "#000",
    height: "8%",
    width: '50%',
    borderRadius: 5,
    paddingLeft: 5,
    font:{
        fontSize: Alloy.Globals.smallfont,
        fontFamily: 'Ubuntu-C'
    },
    autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
    softKeyboardOnFocus: Titanium.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS,
    keyboardType: Ti.UI.KEYBOARD_EMAIL
},
"#Password[platform=ios]":{
    top: "2%",
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    color: "#000",
    height: "8%",
    width: '50%',
    borderRadius: 5,
    paddingLeft: 5,
    font:{
        fontSize: Alloy.Globals.smallfont,
        fontFamily: 'Ubuntu-C'
    },
    borderColor: "#101518",
    borderWidth: 0.5,
    borderRadius: 5,
    keyboardType: Ti.UI.KEYBOARD_EMAIL,
    returnKeyType: Ti.UI.RETURNKEY_DONE
}

Viewing all articles
Browse latest Browse all 352

Trending Articles