CAWaterfallView(瀑布流控件)

2018-09-08 15:36 更新


類說明

CAWaterfallView 由很多的格子組成,但是每個格子的寬度和高速都是不確定的,是在動態(tài)改變的,就像瀑布一樣,是一條線一條線的。


CAWaterfallView 屬性(點擊查看方法介紹)

屬性說明
WaterfallViewDataSource添加數(shù)據(jù)代理
WaterfallViewDelegate添加交互代理
WaterfallHeaderView添加頭部視圖
WaterfallFooterView添加尾部視圖
WaterfallHeaderHeight設(shè)置頭部的高度
WaterfallFooterHeight設(shè)置尾部的高度
ColumnCount列計數(shù)
ItemMargin項目邊緣
ColumnMargin列邊緣
AllowsSelection允許選擇
AllowsMultipleSelection允許多個選擇
AlwaysTopSectionHeader總是顯示頂部
AlwaysBottomSectionFooter總是顯示底部


CAWaterfallView 方法(點擊查看方法介紹)

方法說明
createWithFrame創(chuàng)建,并指定其Frame
createWithCenter創(chuàng)建,并設(shè)置其Center
init初始化
reloadData重載數(shù)據(jù)
dequeueReusableCellWithIdentifier從復用隊列中尋找指定標識符的cell
setAllowsSelection是否開啟cell選擇
setAllowsMultipleSelection是否可以多選cell
setSelectRowAtIndexPath通過索引選擇一行
setUnSelectRowAtIndexPath通過索引取消選擇一行
setShowsScrollIndicators顯示滾動指示器
cellForRowAtIndexPath根據(jù)索引獲取顯示的cell
displayingWaterfallCell顯示W(wǎng)aterfall的Cell
getHighlightWaterfallCell突出Waterfall的Cell
switchPCMode開關(guān)PC模式


CAWaterfallView 屬性說明

WaterfallViewDataSource

類型:CAWaterfallViewDataSource*

解釋:添加數(shù)據(jù)代理,set/get{}。


WaterfallViewDelegate

類型:CAWaterfallViewDelegate*

解釋:添加交互代理,set/get{}。


WaterfallHeaderView

類型:CAView*

解釋:添加頭部視圖,set/get{}。


WaterfallFooterView

類型:CAView*

解釋:添加尾部視圖,set/get{}。


WaterfallHeaderHeight

類型:unsigned int

解釋:設(shè)置頭部的高度,set/get{}。


WaterfallFooterHeight

類型:unsigned int

解釋:設(shè)置尾部的高度,set/get{}。


ColumnCount

類型:unsigned int

解釋:列計數(shù),set/get{}。


ItemMargin

類型:unsigned int

解釋:項目邊緣,set/get{}。


ColumnMargin

類型:unsigned int

解釋:列邊緣,set/get{}。


AllowsSelection

類型:bool

解釋:允許選擇,is{}。


AllowsMultipleSelection

類型:bool

解釋:允許多個選擇,is{}。


AlwaysTopSectionHeader

類型:bool

解釋:總是顯示頂部,is/set{}。


AlwaysBottomSectionFooter

類型:bool

解釋:總是顯示底部,is/set{}。


CAWaterfallView 方法說明

static CAWaterfallView* createWithFrame(const DRect& rect);

返回值:CAWaterfallView*

參數(shù):

類型參數(shù)名說明
const DRect&rect區(qū)域大小 

解釋:創(chuàng)建,并指定其Frame


static CAWaterfallView* createWithCenter(const DRect& rect);

返回值:CAWaterfallView*

參數(shù):

類型參數(shù)名說明
const DRect&rect中心點的位置及大小

解釋:

創(chuàng)建,并設(shè)置其Center


virtual bool init();

返回值:bool

參數(shù):

解釋:初始化


void reloadData();

返回值:void

參數(shù):

解釋:重載數(shù)據(jù)


CAWaterfallViewCell* dequeueReusableCellWithIdentifier(const char* reuseIdentifier);

返回值:CAWaterfallViewCell*

參數(shù):

類型參數(shù)名說明
const char*reuseIdentifier重用標識符

解釋:從復用隊列中尋找指定標識符的cell


virtual void setAllowsSelection(bool var);

返回值:void

參數(shù):

類型參數(shù)名說明
boolvar是否開啟

解釋:是否開啟cell選擇


virtual void setAllowsMultipleSelection(bool var);

返回值:void

參數(shù):

類型參數(shù)名說明
boolvar是否開啟

解釋:是否可以多選cell


void setSelectRowAtIndexPath(unsigned int itemIndex);

返回值:void

參數(shù):

類型參數(shù)名說明
unsigned intitemIndex項目Index

解釋:通過索引選擇一行


void setUnSelectRowAtIndexPath(unsigned int itemIndex);

返回值:void

參數(shù):

類型參數(shù)名說明
unsigned intitemIndex項目Index

解釋:通過索引取消選擇一行


virtual void setShowsScrollIndicators(bool var);

返回值:void

參數(shù):

類型參數(shù)名說明
boolvar是否開啟

解釋:顯示滾動指示器


CAWaterfallViewCell* cellForRowAtIndexPath(unsigned int itemIndex);

返回值:CAWaterfallViewCell*

參數(shù):

類型參數(shù)名說明
unsigned intitemIndex項目Index

解釋:根據(jù)索引獲取顯示的cell


const CAVector<CAWaterfallViewCell*>& displayingWaterfallCell();

返回值:CAVector<CAWaterfallViewCell*>&

參數(shù):

解釋:顯示W(wǎng)aterfall的Cell


CAWaterfallViewCell* getHighlightWaterfallCell();

返回值:CAWaterfallViewCell*

參數(shù):

解釋:突出Waterfall的Cell


virtual void switchPCMode(bool var);

返回值:void

參數(shù):

類型參數(shù)名說明
boolvar是否開啟

解釋:開關(guān)PC模式







以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號