[英]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:无论如何,我建议你两种方式:
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
.设置它的
delegate
和dataSource
。 Use delegate
methods to get data and use dataSource
methods to set data to UIPickerView
.使用
delegate
方法获取数据并使用dataSource
方法将数据设置为UIPickerView
。
In UITableView
's tableView:didSelectRowAtIndexPath:
method and implement UIPickerView
delegate
and dataSource
methods same as in first option.在
UITableView
的tableView:didSelectRowAtIndexPath:
方法中并实现UIPickerView
delegate
和dataSource
方法与第一个选项相同。 Update cells' data using these methods.使用这些方法更新单元格的数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.