Created
February 27, 2013 16:18
-
-
Save KarthiPnsmy/5049158 to your computer and use it in GitHub Desktop.
keyboard bounce issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var platform = Ti.Platform.osname; | |
var winObj = { | |
height: Ti.UI.FILL, | |
width: Ti.UI.FILL, | |
navBarHidden : true, | |
exitOnClose : false | |
}; | |
if(platform == "android"){ | |
winObj.windowSoftInputMode = Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE | Ti.UI.Android.SOFT_INPUT_STATE_ALWAYS_HIDDEN; | |
winObj.orientationModes = [Titanium.UI.PORTRAIT]; | |
} | |
var win = Ti.UI.createWindow(winObj); | |
win.open(); | |
var containerView = Ti.UI.createView({ | |
viewType : "regStep1", | |
height: Ti.UI.FILL, | |
backgroundColor: "#fff" | |
}); | |
win.add(containerView); | |
var step1Container = Ti.UI.createScrollView({ | |
backgroundColor:'#ccc', | |
height: Ti.UI.SIZE, | |
layout: "vertical", | |
top:100, | |
left: 10, | |
right: 10, | |
bottom: 20 | |
}); | |
containerView.add(step1Container); | |
var field1 = Titanium.UI.createTextField({ | |
hintText : 'Field 1', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_NEXT | |
}); | |
step1Container.add(field1); | |
var field2 = Titanium.UI.createTextField({ | |
hintText : 'Field 2', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_NEXT | |
}); | |
step1Container.add(field2); | |
var view1 = Titanium.UI.createView({ | |
top : 15, | |
backgroundColor:'red', | |
width:200, | |
height:50 | |
}); | |
step1Container.add(view1); | |
var field3 = Titanium.UI.createTextField({ | |
hintText : 'Field 3', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_NEXT | |
}); | |
step1Container.add(field3); | |
var field4 = Titanium.UI.createTextField({ | |
hintText : 'Field 4', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_NEXT | |
}); | |
step1Container.add(field4); | |
var view2 = Titanium.UI.createView({ | |
top : 15, | |
backgroundColor:'blue', | |
width:200, | |
height:50 | |
}); | |
step1Container.add(view2); | |
var field5 = Titanium.UI.createTextField({ | |
hintText : 'Field 5', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_NEXT | |
}); | |
step1Container.add(field5); | |
var field6 = Titanium.UI.createTextField({ | |
hintText : 'Field 6', | |
paddingLeft:3, | |
color : '#000', | |
font : { | |
fontSize : 12, | |
fontFamily : 'Helvetica Neue' | |
}, | |
height : 35, | |
top : 15, | |
width : 200, | |
suppressReturn : true, | |
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, | |
returnKeyType : Titanium.UI.RETURNKEY_DONE | |
}); | |
step1Container.add(field6); | |
field1.addEventListener('return', function(){ | |
field2.focus(); | |
}); | |
field1.addEventListener('return', function(){ | |
field2.focus(); | |
}); | |
field2.addEventListener('return', function(){ | |
field3.focus(); | |
}); | |
field3.addEventListener('return', function(){ | |
field4.focus(); | |
}); | |
field4.addEventListener('return', function(){ | |
field5.focus(); | |
}); | |
field5.addEventListener('return', function(){ | |
field6.focus(); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment