-

类说明

CAPickerView的滚动事件的代理


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

方法说明
numberOfComponentsInPickerView获取PickerView的Component数量
numberOfRowsInComponent获取PickerView的Component行数
widthForComponentPickerView的Component宽度
rowHeightForComponentPickerView的Component高度
titleForRowPickerView的Row标题
viewForRowPickerView的背景图像
viewForSelectPickerView的选中时图像


CAPickerViewDelegate 方法说明

virtual unsigned int numberOfComponentsInPickerView(CAPickerView* pickerView) = 0; 

返回值:unsigned int

参数:

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

解释:获取PickerView的Component数量


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

返回值:unsigned int

参数:

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

解释:获取PickerView的Component行数


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

返回值:float

参数:

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

解释:PickerView的Component宽度


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

返回值:float

参数:

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

解释:PickerView的Component高度


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

返回值:const char*

参数:

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

解释:PickerView的Row标题


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

返回值:CAView* 

参数:

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

解释:PickerView的背景图像


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

返回值:CAView* 

参数:

类型参数名说明
CAPickerView* pickerView当前pickerView
unsigned intcomponent当前选中的component
const DSize&size图像大小

解释:PickerView的选中时图像