简体   繁体   English

如何以简单的方式在滑动表格单元格上显示自定义选项

[英]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.

相关问题 滑动表格单元格以获得两个选项 - Swipe a table cell to get two options 在自定义滑动(而不是滑动以删除)中的一个单元格上单击时,如何删除在其他TableView单元格中添加的子视图(单元格(滑动到邮件/短信) - How to remove subview added in other TableView cell when tap on one cell, in Custom swipe (instead of swipe to delete) Cell (swipe to mail/sms) 自定义UICollectionView单元格滑动动画 - Custom UICollectionView Cell Swipe Animation 滑动以删除不适用于自定义单元格 - Swipe to delete is not working with custom cell 如何在表格单元格上滑动并使其调用 function? - How can i swipe on a table cell and make it call a function? 将自定义表格单元格一直弹到顶部 - Bouncing custom table cell all the way to the top 我在一个视图上有两个表,一个是自定义表,另一个是简单表,如何在两个表上显示数据? - I have two table on one view one is custom table and other is simple table how to show data on both table? 用户滑动时,表格视图单元格突出显示 - Table View Cell highlight when user swipe 讨论:实现自定义搜索结果表视图单元的最佳方法 - Discussion: Best way to implementing a custom search result table view cell 如何将自定义图像放在表格视图单元格中 - how to put custom image in table view cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM