W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
類說明
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 int | component | 當前的component |
解釋:設定component中row的數(shù)量
virtual float widthForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當前pickerView |
unsigned int | component | 當前的component |
解釋:設定component的寬
virtual float rowHeightForComponent(CAPickerView* pickerView, unsigned int component) {return 0;}
返回值:float
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當前pickerView |
unsigned int | component | 當前的component |
解釋:設定row的高
virtual CCString* titleForRow(CAPickerView* pickerView, unsigned int row, unsigned int component) {return NULL;}
返回值:CCString*
參數(shù):
類型 | 參數(shù)名 | 說明 |
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*
參數(shù):
類型 | 參數(shù)名 | 說明 |
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*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CAPickerView* | pickerView | 當前pickerView |
unsigned int | component | 當前的component |
const CCSize& | size | 被選中row的size |
解釋:設定選中row的view
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: