View Toolbar Example

NKToolbar

Description

Class is used as a utility toolbar.

Usage

init(y)
Initializes toolbar with vertical position 'y'
show()
shows initialized toolbar
hide()
hides initialized toolbar
addButton(title, imageName, callback)
creates button on toolbar
Parameters:
title - button title to be displayed (ignored if imageName specified) imageName - the filename of bundled image to be displayed on button (discards title) callback - javascript function name to be called when button pressed
insertButtonAtIndex(index, title, image, callback)
creates button on toolbar
Parameters:
index - index, used to specify button position, count starts from 1 title - button title to be displayed (ignored if imageName specified) imageName - the filename of bundled image to be displayed on button (discards title) callback - javascript function name to be called when button pressed addDoneButton(title, callback)
creates blue button on toolbar, which has same style is used for "Done" buttons
addFlexibleSpace()
adds flexible space into toolbar, used to align buttons
setStyle(style)
sets the style of toolbar, possible values are: 'black', 'blacktranslucent', 'default'
destroy()
removes and destroys toolbar and resources allocated for it.
removeButtonAtIndex(index)
removed button at specified index (starts at 0)

Example

See source code for multiple examples