UITableView中的多个选择。表格是动态生成的 [英] Multiple selection in UITableView. And the tables are dynamically generated

查看:82
本文介绍了UITableView中的多个选择。表格是动态生成的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个uitableviews。

我使用循环创建了多个表。

表的数量取决于webservice的结果。

每个表都有多个选择。我必须将从每个表中选择的所有值传递给下一个webservice。

I have multiple uitableviews.
I created the multiple tables by using a loop.
The number of tables depend on the result of the webservice.
And each table have multiple selections. I have to pass all the values selected from every table to next webservice.

我该怎么办?

谢谢你,

推荐答案

1->您可以在 UITableView 中使用复选框for mutli部分(复选框可以通过以下方式实现: 的UIButton )。每行一个复选框。

1-> you can use check Boxes for in your UITableView for mutli section (Check box can be implemented by UIButton). one check box per row.

2->使用标志( BOOL isSelected ),在用户设置为true选择一个单元格(tableView:didSelectRowAtIndexPath:),并在下次触摸时将其设为false,

2-> Use a flag (BOOL isSelected),set it true when user select a cell (tableView:didSelectRowAtIndexPath:),and make it false for next touch,

第二种方法可以使用自定义 UITableViewCell 并使用图像向用户显示单元格选择(可以使用 isSelected 更改图像 tableView中的值:didSelectRowAtIndexPath:方法。

for second approach you could use a custom UITableViewCell and use a image to show cell selection to the user (image can be changed by using isSelected value in tableView:didSelectRowAtIndexPath: method.

这篇关于UITableView中的多个选择。表格是动态生成的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆