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

CATableView

Class Description

CATableView is mainly used to generate list and display data in table. This one-dimensional table has either static or dynamic form and enable user to navigate through hierarchical data and implement many customizations via dataSource and delegate protocol. It’s quite efficient even dealing with mass data. CATableView is allowed to only have one column of data (cell) and only support longitudinal sliding.

Effect Picture


Base Class

CAScrollView

Attribute

Access modifier

Attribute name

Description

protected

TableViewDataSource

data delegate

protected

TableViewDelegate

sliding event delegate

private

TableHeaderView

table header view

private

TableFooterView

table footer view

protected

TableHeaderHeight

table header height

protected

TableFooterHeight

table footer height

protected

SeparatorColor

separator color

protected

SeparatorViewHeight

separator height

protected

AllowsSelection

selectable or not

protected

AllowsMultipleSelection

multi selectable or not

protected

AlwaysTopSectionHeader

section header stays at the top or not

protected

AlwaysBottomSectionFooter

section footer stays at the top or not

Method

Access modifier

Method name

Description

public

reloadData

refresh tableView data

 

public

dequeueReusableCellWithIdentifier

search designated identifier’s cell from reuse queue.

public

setSelectRowAtIndexPath

set current selected cell

 

Attribute Description

TableHeaderView
Type: CAView*
Descripiton: tableView’s header view, get/set{}.

TableFooterView
Type: CAView*
Descripiton: tableView’s table footer view, get/set{}.

TableHeaderHeight
Type: unsigned int
Descripiton: tableView’s table header height, get/set{}.

TableFooterHeight
Type: unsigned int
Descripiton: tableView’s table footer height, get/set{}.

SeparatorColor
Type: CAColor4B
Descripiton: separator color, get/set{}.

SeparatorViewHeight
Type: unsigned int
Descripiton: separator height between cells, public get/set{}.

AllowsSelection
Type: bool
Descripiton: cell is allowed to be selected or not, false by default, is/set{}.

AllowsMultipleSelection
Type: bool
Descripiton: multi-select is allowed or not, it’s allowed only when m_bAllowsSelection is true, false by default, is/set{}.

AlwaysTopSectionHeader
Type: bool
Descripiton: allow sectionHeader alway stays tableView’ top or not when cell is sliding out of interface, true by default, is/set{}.

AlwaysBottomSectionFooter
Type: bool
Descripiton: allow sectionFooter alway stays tableView’ bottom or not when cell is sliding out of interface, true by default, is/set{}.

Method Description

void reloadData()
Return value: void
Descripiton: refresh tableView data

CATableViewCell dequeueReusableCellWithIdentifier(const char reuseIdentifier)**
Return value: CATableViewCell*
Parameter:

Type

Parameter name

Description

const char*

reuseIdentifier

reuse identifier

Descripiton: search designated identifier’s cell from reuse queue, and return NULL if cell does not exist.

void setSelectRowAtIndexPath(unsigned int section, unsigned int row)
Return value: void
Parameter:

Type

Parameter name

Description

unsigned int

section

cell’s located section

unsigned int

row

cell’s index value

Descripiton: set current selected cell according to designated section and row value.
Clone this wiki locally