iphone UIPickerView 选择行
我的视图包含 UIPickerView... 我尝试编写此代码:
[self.picker selectRow:rowSelected inComponent:0 animated:true];
选择具有索引 rowSelected 的行,但这不起作用...... 我需要把它放在 viewdidload 中?
I have my view that contains the UIPickerView...
I tried to make this code:
[self.picker selectRow:rowSelected inComponent:0 animated:true];
to select the row with index rowSelected, but this doesn't work...
I need to put this in viewdidload??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您自己不调用此方法。当用户在选择器视图中选择一行时,系统会调用它。您应该重写该方法的实现,以在用户选择该组件中的该行时执行您希望发生的任何操作。
You do not call this method yourself. It is called by the system when a user selects a row in the pickerview. You should override the implementation of that method to do whatever you wish should happen when the user selects that row in that component.