W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
類說明
CAPickerView的數(shù)據(jù)代理
CAPickerViewDataSource 方法(點(diǎn)擊查看方法介紹)
方法 | 說明 |
numberOfComponentsInPickerView | 設(shè)定component的數(shù)量 |
numberOfRowsInComponent | 設(shè)定component中row的數(shù)量 |
widthForComponent | 設(shè)定component的寬 |
rowHeightForComponent | 設(shè)定row的高 |
titleForRow | 設(shè)定row的顯示內(nèi)容 |
viewForRow | 設(shè)定備選row的view |
viewForSelect | 設(shè)定選中row的view |
CAPickerViewDataSource 方法說明
virtual unsigned int numberOfComponentsInPickerView(CAPickerView* pickerView) = 0
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
類型 參數(shù)名 說明
CAPickerView* pickerView 當(dāng)前pickerView
解釋:設(shè)定component的數(shù)量
virtual unsigned int numberOfRowsInComponent(CAPickerView* pickerView, unsigned int component) = 0
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | component | 當(dāng)前的component |
解釋:設(shè)定component中row的數(shù)量
virtual float widthForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | component | 當(dāng)前的component |
解釋:設(shè)定component的寬
virtual float rowHeightForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | component | 當(dāng)前的component |
解釋:設(shè)定row的高
virtual CCString* titleForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:CCString*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | row | 當(dāng)前的row |
unsigned int | component | 當(dāng)前的component |
解釋:設(shè)定row的顯示內(nèi)容
virtual CAView* viewForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:CAView*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | row | 當(dāng)前的row |
unsigned int | component | 當(dāng)前的component |
解釋:設(shè)定row的顯示內(nèi)容
virtual CAView* viewForSelect(CAPickerView* pickerView, unsigned int component, const CCSize& size) {return NULL;}
返回值:CAView*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當(dāng)前pickerView |
unsigned int | component | 當(dāng)前的component |
const CCSize& | size | 被選中row的size |
解釋:設(shè)定選中row的view
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: