Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tab and app badges are indicators of updates, new messages, and so forth. You can apply these badges, with a numeric value, to your app and to tabs within your app. Doing so is quite simple. For tabs, simply set the yourTab.badge property equal to some number to show the tab badge icon. For your app, set the Ti.UI.iPhoneiOS.appBadge property equal to a number to show the app badge icon. You might do so when your app initializes or shuts down. You could also use a background service to set your app's badge as needed.

...

Code Block
langjavascript
// Sets the app's icon badge to 23
Ti.UI.iPhoneiOS.appBadge = 23;

var tabGroup = TitaniumTi.UI.createTabGroup();
var win1 = TitaniumTi.UI.createWindow({
    title: 'Window 1',
    backgroundColor: '#fff'
});

// Set the badge for this tab to 10
var tab1 = TitaniumTi.UI.createTab({
    icon: 'KS_nav_viewsmyIcon.png',
    title: 'Tab 1',
    window: win1,
    badge: 10
});

...