您可以在单个 UIPickerView 中混合自定义视图和非自定义视图组件吗?
我的应用程序中有一个多组件 UIPickerView。两个组件是简单的,并且完全由 pickerView:titleForRow:forComponent:
方法提供服务。然而,我的第三个组件需要通过 pickerView:viewForRow:forComponent:reusingView:
方法自定义视图。我在文档中没有看到任何方式可以有一个“部分定制”的 UIPickerView,其中一些组件使用 ...titleForRow...
,一些组件使用 ...viewForRow...< /代码>。这可能吗?如果是这样,如何做到这一点?
I have a multi-component UIPickerView in my application. Two components are plain and completely served by the pickerView:titleForRow:forComponent:
method. My third component however requires a custom view via the pickerView:viewForRow:forComponent:reusingView:
method. I don't see any way in the documentation to have a "partially customized" UIPickerView where some components use ...titleForRow...
and some use ...viewForRow...
. Is this possible? If so, how does one do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你必须要么全走,要么全走。简单、无聊的默认视图几乎只是一个 UILabel。您应该能够轻松地重新创建此视图。
You've got to go all or nothing. The plain, boring default views are pretty much just a UILabel. You should be able to easily recreate this view.