开发者

How to add button to the last section of the UItableviewcontroller?

开发者 https://www.devze.com 2023-04-12 17:35 出处:网络
i would like to add last section of UiTableviewcontroller with image button. In my app i have taken开发者_Go百科 TableViewController.

i would like to add last section of UiTableviewcontroller with image button.

In my app i have taken开发者_Go百科 TableViewController.

In that i set table view style as grouped data. I have created section in table view.

Now i want to put Custom button in the last section of table view which scroll with the table view . How to set last section with custom button image?


You can have a button on the bottom of a table view by several ways. You can add the button as the footer view of the table (or as the footer view of the last section of the table view).

tableView.tableFooterView = theImageButton;

If you really want to have it in a section, you can add the last section with just 1 row and add the button as the subview of the cell's contentView.

[cell.contentView addSubview:theImageButton];


Add the button to tableview.tablefooterView.

I use that way in the case you described.


Adding into footer is really easy to implement. You can add anything as a view there button/image [cell.contentView addSubview:view];

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号