CAPickerViewDelegate
类说明
CAPickerView的滚动事件的代理
CAPickerViewDelegate 方法(点击查看方法介绍)
方法 | 说明 |
numberOfComponentsInPickerView | 获取PickerView的Component数量 |
numberOfRowsInComponent | 获取PickerView的Component行数 |
widthForComponent | PickerView的Component宽度 |
rowHeightForComponent | PickerView的Component高度 |
titleForRow | PickerView的Row标题 |
viewForRow | PickerView的背景图像 |
viewForSelect | PickerView的选中时图像 |
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 int | component | 当前选中的component |
解释:获取PickerView的Component行数
virtual float widthForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前选中的component |
解释:PickerView的Component宽度
virtual float rowHeightForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前选中的component |
解释:PickerView的Component高度
virtual const char* titleForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:const char*
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | row | 当前选中的row |
unsigned int | component | 当前选中的component |
解释:PickerView的Row标题
virtual CAView* viewForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:CAView*
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | row | 当前选中的row |
unsigned int | component | 当前选中的component |
解释:PickerView的背景图像
virtual CAView* viewForSelect(CAPickerView* pickerView, unsigned int component, const DSize& size) {return NULL;}
返回值:CAView*
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前选中的component |
const DSize& | size | 图像大小 |
解释:PickerView的选中时图像
更多建议: