Created
December 6, 2011 05:09
-
-
Save alanleard/1436845 to your computer and use it in GitHub Desktop.
Indicators on Tabgroup & TabbedBar
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
var win = Ti.UI.createWindow(); | |
var tabGroup = Ti.UI.createTabGroup(); | |
function indicator(count, top, left, color){ | |
var label = Ti.UI.createLabel({ | |
backgroundColor:color, | |
text:count, | |
borderColor:'#fff', | |
borderRadius:10, | |
borderWidth:2, | |
height:20, | |
width:20, | |
color:'#fff', | |
font:{fontWeight:'bold'}, | |
textAlign:'center', | |
top:top, | |
left:left, | |
touchEnabled:false | |
}); | |
return label; | |
} | |
var win1 = Titanium.UI.createWindow({ | |
title:'1', | |
backgroundColor:'#fff' | |
}); | |
var bb1 = Titanium.UI.createTabbedBar({ | |
labels:['One', 'Two', 'Three'], | |
backgroundColor:'#336699', | |
style:Titanium.UI.iPhone.SystemButtonStyle.BAR, | |
height:49, | |
width:200, | |
top:50 | |
}); | |
bb1.add(indicator('2',-3,180, 'blue')); | |
win1.add(bb1); | |
var tab1 = Titanium.UI.createTab({ | |
icon:'KS_nav_views.png', | |
title:'1', | |
window:win1 | |
}); | |
tabGroup.addTab(tab1); | |
var win2 = Titanium.UI.createWindow({ | |
title:'2', | |
backgroundColor:'#fff' | |
}); | |
var tab2 = Titanium.UI.createTab({ | |
icon:'KS_nav_views.png', | |
title:'2', | |
window:win2 | |
}); | |
tabGroup.addTab(tab2); | |
tabGroup.open(); | |
tabGroup.add(indicator('2',405,300,'red')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment