为uitableview创建自定义删除按钮 [英] create custom delete button for uitableview

查看:78
本文介绍了为uitableview创建自定义删除按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ios应用程序,我的问题是如何更改滑动上的默认按钮以在uitableview上删除。我看到我可以使用titleForDeleteConfirmationButtonForRowAtIndexPath更改文本,但我想完全更改图像。香港专业教育学院一直在寻找一种方式,所有关于它的帖子可能已经过时,所以在我继续这个之前,我想与人们确认一下。我要做的是为单元格本身添加一个手势识别器,以捕获用户在单个单元格上滑动,然后添加我的自定义按钮并从那里重新排列单元格框架,只是忘记了苹果默认滑动以完全删除。怎么声音?

Im working on an ios app and my question is how to change the default button on swipe to delete on a uitableview. i see i can change the text with titleForDeleteConfirmationButtonForRowAtIndexPath but i want to change the image completely. ive been looking around for a way and all the posts about it may be out of date so just want to confirm with people before i go ahead with this. What im going to do is add a gesture recogniser to the cells themselves to catch the users swipe on individual cells and then add in my custom button and re arrange the cell frame from there and just forget about apples default swipe to delete completely. how that sound?

推荐答案

这是一个很棒的开源类,基于Twitter应用程序的行为来完成这个:

Here is a great open-source class for doing exactly this, based on the behavior of the Twitter app:

https://github.com/thermogl/TISwipeableTableView

这篇关于为uitableview创建自定义删除按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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