如何在 iPhone 中重新加载 UIPickerView?
你好 我正在开发 iPhone 应用程序 &在收到来自套接字的响应后,我必须在 pickerview 上显示一些内容,PickerView 的方法是在应用程序加载时进行检查。在我的应用程序中,我必须在单击按钮时加载 PickerView。
在数组中获得响应后,当我单击按钮时,它会显示一个选择器视图,但为空。 :( 那么任何人都可以告诉我如何重新加载像 tableView 这样的 pickerview 吗?
提前感谢
hi
I am working on an iPhone app & i have to show some thing on a pickerview after receiving a response from socket, Methods of PickerView are check when application is going to be load. in my app i have to load PickerView on a button click.
After getting response in an array, When i click on button its shows a pickerview but empty. :(
SO can any body tell me how to reload the pickerview like tableView.
Thanx in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用
reloadAllComponents
来重新加载所有组件,或者使用reloadComponent
来重新加载一个零索引数字,以标识选取器视图的组件。阅读 UIPickerView 文档
you could use either
reloadAllComponents
to realod all the component orreloadComponent
to a zero-indexed number identifying a component of the picker view.Read UIPickerView documentation
您可以使用下面的代码,我希望它有效
You can use below code, I hope it's work
调用
-reloadComponent:
或-reloadAllComponents
(UIPickerView)。引用:
Call
-reloadComponent:
or-reloadAllComponents
(methods on UIPickerView).Quote:
使用UIPickerView类的这个方法
- (void)reloadAllComponents
。Use this method
- (void)reloadAllComponents
of the UIPickerView class.