how to make swipeable UItableview header to show delete button like cells

与世无争的帅哥 提交于 2021-02-07 14:42:51

问题


I have a custom header which is sub class of UITableViewHeaderFooterView I want to add the delete button similar to UITableViewCell to this header, I have gone through the internet and found some open source libraries to create swipeable cell which only extend the functionality of UITableviewCell which actually I don't need for the time,

What I actually want is to create a swipeable header View to show the delete button on swipe.


回答1:


There is not out of the box solution for this. However we can still do it by our own custom delete button. The idea is to have a UIButton under the header content view and animate it when swiping on header.

Ray Wenderlichs has a great tutorial for How To Make A Swipeable Table View Cell With Actions Use the same logic for UITableViewHeaderFooterView and you are good to go.



来源:https://stackoverflow.com/questions/36301970/how-to-make-swipeable-uitableview-header-to-show-delete-button-like-cells

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