如何在UITableView单元格中实现从左到右滑动,类似于iOS Mail [英] How to Implement Swipe Left to Right in UITableView Cell similar to iOS Mail

查看:127
本文介绍了如何在UITableView单元格中实现从左到右滑动,类似于iOS Mail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试复制Apple在其邮件应用中使用的相同技术,以便在邮箱内从左向右滑动时将邮件标记为未读或标记为未读。





我发现。


I'm trying to replicate the same technique that Apple uses in their mail app for marking mail as unread or "Mark as Unread" when you swipe from left to right inside a mailbox.

I've found similar solutions but only for a gesture of swiping from right to left. I was hoping that this same solution was available as part of the Apple SDK for the opposite direction.

How can I acheive the same left-to-right gesture effect as iOS' Mail app does?

解决方案

I've found similar solutions but only for a gesture of swiping from right to left.

SWTableViewCell has all the options you might want.

While dequeing a cell just set up left/right set of buttons as needed.

cell.leftUtilityButtons = [self leftButtons];
cell.rightUtilityButtons = [self rightButtons];
cell.delegate = self;

And by setting the view controller as its delegate, you can listen to the button clicks. Full details on how to implement are in that link

Ex 1:

Ex 2:

In case you are looking for buttons stacked vertically check out this.

这篇关于如何在UITableView单元格中实现从左到右滑动,类似于iOS Mail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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