Created
March 4, 2011 08:41
-
-
Save nurtext/854344 to your computer and use it in GitHub Desktop.
[Titanium] TableView with TextView jumping when it gets focussed
This file contains 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
Ti.UI.setBackgroundColor('#fff'); | |
var tabGroup = Ti.UI.createTabGroup(); | |
var win1 = Ti.UI.createWindow({ | |
title:'Tab 1', | |
backgroundColor:'#fff' | |
}); | |
var tab1 = Ti.UI.createTab({ | |
icon:'KS_nav_views.png', | |
title:'Tab 1', | |
window:win1 | |
}); | |
var label1 = Ti.UI.createLabel({ | |
color:'#999', | |
text:'Open modal window', | |
font:{fontSize:20,fontFamily:'Helvetica Neue'}, | |
textAlign:'center', | |
width:'auto' | |
}); | |
label1.addEventListener('click', function(e) | |
{ | |
var row = Ti.UI.createTableViewRow({ | |
className: 'control', | |
selectionStyle: Ti.UI.iPhone.TableViewCellSelectionStyle.NONE | |
}); | |
var txt = Ti.UI.createTextField({ | |
hintText: 'Click me to see me jumping' | |
}); | |
row.add(txt); | |
var btnclose = Ti.UI.createButton({title: 'Close'}); | |
var winmodal = Ti.UI.createWindow({ | |
title:'TextView Jumping', | |
modal: true, | |
rightNavButton: btnclose | |
}); | |
var tableview = Ti.UI.createTableView({data: [row]}); | |
btnclose.addEventListener('click', function(e){ | |
winmodal.close(); | |
}); | |
winmodal.add(tableview); | |
winmodal.open(); | |
}); | |
win1.add(label1); | |
tabGroup.addTab(tab1); | |
tabGroup.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment