codecamp

CAPickerViewDataSource

类说明

        CAPickerView的数据代理


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

方法说明
numberOfComponentsInPickerView设定component的数量
numberOfRowsInComponent设定component中row的数量
widthForComponent设定component的宽
rowHeightForComponent设定row的高
titleForRow设定row的显示内容
viewForRow设定备选row的view
viewForSelect设定选中row的view


CAPickerViewDataSource 方法说明

virtual unsigned int numberOfComponentsInPickerView(CAPickerView* pickerView) = 0

返回值:unsigned int

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView

类型 参数名 说明

CAPickerView* pickerView 当前pickerView

解释:设定component的数量


virtual unsigned int numberOfRowsInComponent(CAPickerView* pickerView, unsigned int component) = 0

返回值:unsigned int

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned intcomponent当前的component

解释:设定component中row的数量


virtual float widthForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}

返回值:float

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned intcomponent当前的component

解释:设定component的宽

 

virtual float rowHeightForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}

返回值:float

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned intcomponent当前的component

解释:设定row的高

 

virtual CCString* titleForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}

返回值:CCString*

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned introw当前的row
unsigned intcomponent当前的component

解释:设定row的显示内容

 

virtual CAView* viewForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}

返回值:CAView*

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned introw当前的row
unsigned intcomponent当前的component

解释:设定row的显示内容

 

virtual CAView* viewForSelect(CAPickerView* pickerView, unsigned int component, const CCSize& size) {return NULL;}

返回值:CAView*

参数:

类型参数名说明
CAPickerView*pickerView当前pickerView
unsigned intcomponent当前的component
const CCSize&size被选中row的size

解释:设定选中row的view

CAPickerView(视图选择器)
CAPickerViewDelegate
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

四、调用系统支持

八、宏定义

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }