CAPickerViewDelegate

2018-09-08 15:31 更新

類說明

CAPickerView的滾動(dòng)事件的代理


CAPickerViewDelegate 方法(點(diǎn)擊查看方法介紹)

方法說明
numberOfComponentsInPickerView獲取PickerView的Component數(shù)量
numberOfRowsInComponent獲取PickerView的Component行數(shù)
widthForComponentPickerView的Component寬度
rowHeightForComponentPickerView的Component高度
titleForRowPickerView的Row標(biāo)題
viewForRowPickerView的背景圖像
viewForSelectPickerView的選中時(shí)圖像


CAPickerViewDelegate 方法說明

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

返回值:unsigned int

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView

解釋:獲取PickerView的Component數(shù)量


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

返回值:unsigned int

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned intcomponent當(dāng)前選中的component

解釋:獲取PickerView的Component行數(shù)


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

返回值:float

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned intcomponent當(dāng)前選中的component

解釋:PickerView的Component寬度


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

返回值:float

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned intcomponent當(dāng)前選中的component

解釋:PickerView的Component高度


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

返回值:const char*

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned introw當(dāng)前選中的row
unsigned intcomponent當(dāng)前選中的component

解釋:PickerView的Row標(biāo)題


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

返回值:CAView* 

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned introw當(dāng)前選中的row
unsigned intcomponent當(dāng)前選中的component

解釋:PickerView的背景圖像


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

返回值:CAView* 

參數(shù):

類型參數(shù)名說明
CAPickerView* pickerView當(dāng)前pickerView
unsigned intcomponent當(dāng)前選中的component
const DSize&size圖像大小

解釋:PickerView的選中時(shí)圖像

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號