如何在 xcode 4.2 故事板中使用 UIPickerview?
我正在尝试在我的项目中使用 UIPickerView,但我不知道如何以故事板格式使用它们。有谁知道该怎么做?
I am trying to use a UIPickerView
for my project but I can't figure out how to use them in the storyboard format. Does anyone know how to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这篇文章将带您完成 xcode 4.2 的整个过程
UIPickerView - 如何填充
This post takes you through the process w/xcode 4.2
UIPickerView - How to populate
我验证了它对于故事板的行为与对于 xib 文件的行为相同。将
UIPickerView
添加到视图后,右键单击它以显示delegate
和datasource
出口。仔细检查视图的UIViewController
是否是UIPickerViewDataSource
和UIPickerViewDelegate
,否则您将无法附加这些插座,除非是。I verified and it behaves the same for storyboards as it does for xib files. After adding the
UIPickerView
to a view, right click it to reveal thedelegate
anddatasource
outlets. Double check that yourUIViewController
for the view is aUIPickerViewDataSource
andUIPickerViewDelegate
, or you will not be able to attach these outlets unless it is.