Create 2 column in UITableview [duplicate]

无人久伴 提交于 2020-01-23 19:03:23

问题


Possible Duplicate:
iPhone Multiple Columns in UITableView

Anyone help how to create 2 column tableview in ios?


回答1:


You have to create custom cell view for this task. And add this custom cell in yourTable View.

Check this link for more info Link Link 2

According to your query you just make customButton instead of images and then set image and tagValue to that button, so whenever you will press button you can identify using tagValue.

For yourTable Row

bt1.tag = [NSString stringWithFormat:@"%d0",indexPath.row];
bt2.tag = [NSString stringWithFormat:@"%d1",indexPath.row];

and then manipulate this..:)




回答2:


The easiest way to do this is to create two table views and place them side by side. Make yourself the delegate and dataSource of both, and when one is scrolled scroll the other to match pragmatically. This will give the user the impression that the table view has two columns. Then, when figuring out what cells to give to the tables you just need to examine the tableView argument to determine what is what.



来源:https://stackoverflow.com/questions/13678364/create-2-column-in-uitableview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!