开发者

Referencing different rows in UIPicker

开发者 https://www.devze.com 2023-01-02 15:10 出处:网络
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

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

精彩评论

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

关注公众号