Now that I have my UIPicker split into multiple rows, how do I reference those indi开发者_StackOverflow中文版vidual rows when setting their values?
The UIPickerView
UIPickerViewDelegate
protocol has a method pickerView:titleForRow:forComponent:
- the component is the "wheel" you are concerned with, indexed from 0 at the left. The row is the list of values that can appear in a component. You must set the UIPickerView delegate
and datasource
members to an object or objects that implement the UIPickerViewDelegate
and UIPickerViewDataSource
protocols. If you have it split into multiple components (vertical columns or wheels) already then you have probably already got a UIPickerViewDataSource
set up.
精彩评论