ActionBarExtras - Documentation

Content

1. Installation

Get it gitTio

Download the latest distribution ZIP-file and consult the Titanium Documentation on how install it, or simply use the gitTio CLI:

$ gittio install com.alcoapps.actionbarextras

Using it

Please make sure that your window is open before you access the actionbar.

javascript var abextras = require('com.alcoapps.actionbarextras');

2. Properties

3. Methods

4. Dropdown

An ActionBar Dropdown can be created with createDropdown. Make sure you pass a String-Array as titles property. Example:

javascript var dropdown = abextras.createDropdown({ titles: [ "Home", "Search", "Likes", "Settings" ], index: 1 // optional (default: 0) });

Properties

Methods

Events

5. SearchView

You can style an SearchView with Actionbar Extras. This is done with the method:

An example of how to use this is included in the example app.

5. Appendix

Using IconFont with ABX (thanks @casevictor)

`js var icons = require('font-awesome');

activity.onCreateOptionsMenu = function(e) { e.menu.clear();

var createItem = e.menu.add({ itemId: 101, //unique random number showAsAction: Ti.Android.SHOWASACTION_ALWAYS });

abx.setMenuItemIcon({ menu: e.menu, menuItem: createItem, fontFamily: 'FontAwesome', icon: icons.check, color: 'white', size: 30 }) };

activity.invalidateOptionsMenu(); `