简体   繁体   English

如何在已选择的行方法中的 ui tableview 中添加 uipicker 视图

[英]How to add uipicker view in ui tableview in did selected row method

How to add UIPickerView in UITableView in didSelectRow method ,如何在didSelectRow方法中的UITableView中添加UIPickerView

Based on picker selection user select different options in each cell根据选择器选择用户在每个单元格中选择不同的选项

First, when you want to ask a question, you should add some code pieces that you tried.首先,当你想问一个问题时,你应该添加一些你尝试过的代码片段。 In this way, people can help you using your work.通过这种方式,人们可以帮助您使用您的作品。

ANYWAY, I suggest you two ways:无论如何,我建议你两种方式:

  1. Create a custom UITableViewCell class and in setSelected: method create a UIPickerView and add it to window.创建一个自定义UITableViewCell类并在setSelected:方法中创建一个UIPickerView并将其添加到窗口中。 Set its delegate and dataSource .设置它的delegatedataSource Use delegate methods to get data and use dataSource methods to set data to UIPickerView .使用delegate方法获取数据并使用dataSource方法将数据设置为UIPickerView

  2. In UITableView 's tableView:didSelectRowAtIndexPath: method and implement UIPickerView delegate and dataSource methods same as in first option.UITableViewtableView:didSelectRowAtIndexPath:方法中并实现UIPickerView delegatedataSource方法与第一个选项相同。 Update cells' data using these methods.使用这些方法更新单元格的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM