CAPickerViewDataSource

2018-09-08 15:31 更新

類說明

        CAPickerView的數(shù)據代理


CAPickerViewDataSource 方法(點擊查看方法介紹)

方法說明
numberOfComponentsInPickerView設定component的數(shù)量
numberOfRowsInComponent設定component中row的數(shù)量
widthForComponent設定component的寬
rowHeightForComponent設定row的高
titleForRow設定row的顯示內容
viewForRow設定備選row的view
viewForSelect設定選中row的view


CAPickerViewDataSource 方法說明

virtual unsigned int numberOfComponentsInPickerView(CAPickerView* pickerView) = 0

返回值:unsigned int

參數(shù):

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

類型 參數(shù)名 說明

CAPickerView* pickerView 當前pickerView

解釋:設定component的數(shù)量


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

返回值:unsigned int

參數(shù):

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

解釋:設定component中row的數(shù)量


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

返回值:float

參數(shù):

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

解釋:設定component的寬

 

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

返回值:float

參數(shù):

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

解釋:設定row的高

 

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

返回值:CCString*

參數(shù):

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

解釋:設定row的顯示內容

 

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

返回值:CAView*

參數(shù):

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

解釋:設定row的顯示內容

 

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

返回值:CAView*

參數(shù):

類型參數(shù)名說明
CAPickerView*pickerView當前pickerView
unsigned intcomponent當前的component
const CCSize&size被選中row的size

解釋:設定選中row的view

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號