CAWaterfallView(瀑布流控件)

类说明

CAWaterfallView 由很多的格子组成,但是每个格子的宽度和高速都是不确定的,是在动态改变的,就像瀑布一样,是一条线一条线的。


CAWaterfallView 属性(点击查看方法介绍)

属性说明
WaterfallViewDataSource添加数据代理
WaterfallViewDelegate添加交互代理
WaterfallHeaderView添加头部视图
WaterfallFooterView添加尾部视图
WaterfallHeaderHeight设置头部的高度
WaterfallFooterHeight设置尾部的高度
ColumnCount列计数
ItemMargin项目边缘
ColumnMargin列边缘
AllowsSelection允许选择
AllowsMultipleSelection允许多个选择
AlwaysTopSectionHeader总是显示顶部
AlwaysBottomSectionFooter总是显示底部

CAWaterfallView 方法(点击查看方法介绍)

方法说明
createWithFrame创建,并指定其Frame
createWithCenter创建,并设置其Center
init初始化
reloadData重载数据
dequeueReusableCellWithIdentifier从复用队列中寻找指定标识符的cell
setAllowsSelection是否开启cell选择
setAllowsMultipleSelection是否可以多选cell
setSelectRowAtIndexPath通过索引选择一行
setUnSelectRowAtIndexPath通过索引取消选择一行
setShowsScrollIndicators显示滚动指示器
cellForRowAtIndexPath根据索引获取显示的cell
displayingWaterfallCell显示Waterfall的Cell
getHighlightWaterfallCell突出Waterfall的Cell
switchPCMode开关PC模式

CAWaterfallView 属性说明

WaterfallViewDataSource

类型:CAWaterfallViewDataSource*

解释:添加数据代理,set/get{}。

WaterfallViewDelegate

类型:CAWaterfallViewDelegate*

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

WaterfallHeaderView

类型:CAView*

解释:添加头部视图,set/get{}。

WaterfallFooterView

类型:CAView*

解释:添加尾部视图,set/get{}。

WaterfallHeaderHeight

类型:unsigned int

解释:设置头部的高度,set/get{}。

WaterfallFooterHeight

类型:unsigned int

解释:设置尾部的高度,set/get{}。

ColumnCount

类型:unsigned int

解释:列计数,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*

参数:

类型参数名说明
const DRect&rect区域大小 

解释:创建,并指定其Frame

static CAWaterfallView* createWithCenter(const DRect& rect);

返回值:CAWaterfallView*

参数:

类型参数名说明
const DRect&rect中心点的位置及大小

解释:

创建,并设置其Center

virtual bool init();

返回值:bool

参数:

解释:初始化

void reloadData();

返回值:void

参数:

解释:重载数据

CAWaterfallViewCell* dequeueReusableCellWithIdentifier(const char* reuseIdentifier);

返回值:CAWaterfallViewCell*

参数:

类型参数名说明
const char*reuseIdentifier重用标识符

解释:从复用队列中寻找指定标识符的cell

virtual void setAllowsSelection(bool var);

返回值:void

参数:

类型参数名说明
boolvar是否开启

解释:是否开启cell选择

virtual void setAllowsMultipleSelection(bool var);

返回值:void

参数:

类型参数名说明
boolvar是否开启

解释:是否可以多选cell

void setSelectRowAtIndexPath(unsigned int itemIndex);

返回值:void

参数:

类型参数名说明
unsigned intitemIndex项目Index

解释:通过索引选择一行

void setUnSelectRowAtIndexPath(unsigned int itemIndex);

返回值:void

参数:

类型参数名说明
unsigned intitemIndex项目Index

解释:通过索引取消选择一行

virtual void setShowsScrollIndicators(bool var);

返回值:void

参数:

类型参数名说明
boolvar是否开启

解释:显示滚动指示器

CAWaterfallViewCell* cellForRowAtIndexPath(unsigned int itemIndex);

返回值:CAWaterfallViewCell*

参数:

类型参数名说明
unsigned intitemIndex项目Index

解释:根据索引获取显示的cell

const CAVector<CAWaterfallViewCell*>& displayingWaterfallCell();

返回值:CAVector<CAWaterfallViewCell*>&

参数:

解释:显示Waterfall的Cell

CAWaterfallViewCell* getHighlightWaterfallCell();

返回值:CAWaterfallViewCell*

参数:

解释:突出Waterfall的Cell

virtual void switchPCMode(bool var);

返回值:void

参数:

类型参数名说明
boolvar是否开启

解释:开关PC模式






作者:冒牌SEO,如若转载,请注明出处:https://www.web176.com/crossapp/10193.html

(0)
打赏 支付宝 支付宝 微信 微信
冒牌SEO冒牌SEO
上一篇 2023年2月21日 下午2:50
下一篇 2023年2月21日 下午2:50

相关推荐

发表回复

登录后才能评论