Skip to content
9miao edited this page Sep 19, 2014 · 2 revisions

CABarButtonItem

Class Description

custom navigation bar button, it assists navigationBarItem functionality implementation.

Base Class

CABarItem

Attribute

Access modifier

Attribute name

Description

public

HighlightedImage

image in highlight condition

public

Target

callback funciton

Method

Access modifier

Method name

Description

public

create

factory method, create a barButtonItem

public

setTarget

set button’s click event

public

getTarget

obtain the target of click event

public

getSel

obtain callback of click event

Attribute Description

HighlightedImage
Type: CAImage*
Descripiton: image in highlight condition when clicking button

Target
Type: SEL_CAControl
Descripiton: callback event of button

Method Description

static CABarButtonItem create(std: : string title, CAImage image, CAImage* highlightedImage)**
Return value: CABarButtonItem*
Parameter name

Type

Parameter name

Description

string

title

button title

CAImage*

image

image in button’s normal condition

CAImage*

highlightedImage

image in button’s clicked condition

Descripiton: create a barButtonItem and designate title, image.

void setTarget(CCObject target, SEL_CAControl callfunc)*
Return value: void
Parameter name

Type

Parameter name

Description

CCObject*

target

current object

SEL_CAControl

callfunc

function callback of button click event

Descripiton: add a click event for button

CCObject getTarget()*
Return value: CCObject*
Descripiton: obtain current object

SEL_CAControl getSel()
Return value: SEL_CAControl
Descripiton: obtain callback funciton of button’s click event

Clone this wiki locally