WKInterfaceTable:像股票邮件应用一样滑动编辑

Posted

技术标签:

【中文标题】WKInterfaceTable:像股票邮件应用一样滑动编辑【英文标题】:WKInterfaceTable: Swipe to edit like the stock Mail app 【发布时间】:2015-12-27 23:31:57 【问题描述】:

在现有的 Apple Watch 邮件应用程序中,您可以向左滑动以访问更多电子邮件选项。我将如何使用WKInterfaceTable 进行此操作?

【问题讨论】:

【参考方案1】:

根据 Apple 指南,在 watchOS 中不可能像在 ios 中那样实现自定义手势。因为watchOS 中的手势由操作系统自己管理。

苹果怎么说:

Apple Watch 上的用户交互会生成触摸事件和手势,但与 iOS 应用不同的是,您的 Watch 应用不直接处理这些事件。系统为所有触摸事件和手势提供自动响应,响应方式如下:

•   Taps trigger action-based events in your app
•   Vertical swipes scroll the current screen
•   Horizontal swipes display the previous or next page in a page-based interface
•   Left edge swipes navigate back to a parent screen in a hierarchical interface

当用户点击一个按钮或另一个控件时,Apple Watch 会调用该控件的关联操作方法。您为界面中的控件定义操作方法并使用它们来响应用户交互。

More on ***

Apple guideline

【讨论】:

以上是关于WKInterfaceTable:像股票邮件应用一样滑动编辑的主要内容,如果未能解决你的问题,请参考以下文章

WatchOS 在 WKInterfaceTable 中滚动时捕捉到下一行

在 WKInterfaceTable 行中放置一个图像和两个标签

Apple watchkit 应用程序 WKInterfaceTable > Row Controllers > Buttons 操作在 Objective-C 中不起作用

WKInterfaceTable 添加滚动条“flash”并从非滚动视图中删除滚动条

滚动到 WatchKit 中 WKInterfaceTable 的顶部?

如何在 WKInterfaceTable 中创建部分