[英]How to show custom options on swipe table cell in a simple way
I am working on a app which includes table cells.
我正在开发一个包含表格单元格的应用程序。 I want that when i swipe table cell it shows two options, first about that cell value and another for delete that value.
我希望当我刷表格单元格时,它会显示两个选项,首先是关于该单元格值,另一个是删除该值。 How can i show that in a way that the cell value shows in half of cell and the options show in half of cell.
我怎样才能以一种方式显示细胞值显示在细胞的一半中,选项显示在细胞的一半中。
Thanks in advance. 提前致谢。
There are an out of the box solution, called HHPanningTableViewCell . 有一个开箱即用的解决方案,称为HHPanningTableViewCell 。 It does exactly what you need!
它完全符合您的需求!
HHPanningTableViewCell is a UITableViewCell implementing "swipe to reveal" a drawer view.
HHPanningTableViewCell是一个UITableViewCell实现“轻扫以显示”抽屉视图。 Such a view typically holds action buttons applying to the current row.
这种视图通常包含应用于当前行的动作按钮。
This library, SWTableViewCell, should help you: https://github.com/CEWendel/SWTableViewCell 这个库,SWTableViewCell,应该可以帮助你: https : //github.com/CEWendel/SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swipeable content view which exposes utility buttons (similar to iOS 7 Mail Application)
易于使用的UITableViewCell子类,实现可刷新的内容视图,公开实用程序按钮(类似于iOS 7 Mail Application)
You have to create a custom cell and override Apple's behavior which is swipe left to delete and then show your options. 您必须创建一个自定义单元格并覆盖Apple的行为,向左滑动以删除然后显示您的选项。 You can add gesture recognizer to the cell and on swipe to left animate the cell content view and animate in your option view or however you like it to be.
您可以向单元格添加手势识别器,并在向左滑动时为单元格内容视图设置动画,并在选项视图中设置动画,或者您喜欢它。 I can write up an example code if you need.
如果需要,我可以编写一个示例代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.