Monotouch - 填充 UIViewPicker
有没有一种快速方法可以用值填充 UIPickerView?
我将选择器单独放在 XIB 中,当显示视图时,我希望填充 UIPickerView。
有人请赐教吗!!
谢谢
托尼
Is there a quick way to populate a UIPickerView with values?
I have the picker in a XIB all by itself, and when the view is displayed, I would like to have the UIPickerView populated.
Would someone please enlighten me!!
thanks
tony
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要创建一个从 UIPickerViewModel 派生的类,为 GetComponentCount/GetRowsInComponent/GetTitle 提供实现。
然后,在与笔尖关联的控制器中,将选择器的“Model”属性分配给 UIPickerViewModel 派生的实例。
You need to create a class derived from UIPickerViewModel, supplying implementations for GetComponentCount/GetRowsInComponent/GetTitle.
Then, in the controller associated with your nib, assign the "Model" property of your picker to an instance of your UIPickerViewModel derivation.