Skip to content
9miao edited this page Oct 8, 2014 · 2 revisions

CASwitch

Class Description

switch control that is able to implement similarly switch effect.

Effect Picture


Base Class

CAControl

Attribute

Access modifier

Attribute name

Description

protected

OnImage

switch image in on condition

protected

OffImage

switch image in off condition

protected

ThumTintImage

switch’s background image

protected

On

switch is in on condition or not

Method

Access modifier

Method name

Description

public

addTarget

add click event

public

removeTarget

remove click event

Attribute Description

OnImage
Type: CAImage*
Descripiton: image in on condition, get/set{}.

OffImage
Type: CAImage*
Descripiton: image in off condition, get/set{}.

ThumTintImage
Type: CAImage*
Descripiton: background image, get/set{}.

On
Type: bool
Descripiton: read-only property, it’s used to judge switch button is in on condition or not.

Method Description

void addTarget(CAObject target, SEL_CAControl selector)*
Return value: void

Type

Parameter name

Description

CAObject*

target

current object

SEL_CAControl

selector

function callback

Descripiton: add a click event for switch

void removeTarget(CAObject target, SEL_CAControl selector)*
Return value: void
Descripiton: remove switch’s click event

Clone this wiki locally