Monotouch - 填充 UIViewPicker

发布于 2024-10-07 15:47:41 字数 122 浏览 0 评论 0原文

有没有一种快速方法可以用值填充 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

活雷疯 2024-10-14 15:47:41

您需要创建一个从 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文