开发者

Referencing different rows in UIPicker

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜