类说明
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 int | component | 当前的component |
解释:设定component中row的数量
virtual float widthForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前的component |
解释:设定component的宽
virtual float rowHeightForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前的component |
解释:设定row的高
virtual CCString* titleForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:CCString*
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | row | 当前的row |
unsigned int | component | 当前的component |
解释:设定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 |
解释:设定row的显示内容
virtual CAView* viewForSelect(CAPickerView* pickerView, unsigned int component, const CCSize& size) {return NULL;}
返回值:CAView*
参数:
类型 | 参数名 | 说明 |
CAPickerView* | pickerView | 当前pickerView |
unsigned int | component | 当前的component |
const CCSize& | size | 被选中row的size |
解释:设定选中row的view