0

Using Titanium Appcelerator SDK 1.7.1 for iOS 4.3

我有一个 TableViewRow 并且需要在其上触发一个自定义滑动事件(而不是默认的可编辑删除),以便我可以显示 2 个按钮。一个将行标记为完整,另一个删除该行。

问题是显然 TableViewRow 元素上不允许滑动事件。

我尝试过使用 Swipe 事件、touchstart 事件和 touch move 事件,所有这些都带有回调,alert('woot! your finger moved!')但从未触发回调...

有没有人解决过这个问题?

4

1 回答 1

1

这应该有效。

myTableview.addEventListener('swipe', function(eventObject){     
    Titanium.API.info("huzzah, a row was swiped");
});

你的代码是什么样的?

编辑: 您的行中有数据吗?如果没有,请查看将数据放入行中是否有帮助。

编辑: 这些是传递给刷卡事件的事件,因此您可以使用源刷卡行。

direction   direction of the swipe - either left or right
globalPoint a dictionary with properties x and y describing the point of the event in screen coordinates
source  the source object that fired the event
type    the name of the event fired
x   the x point of the event in receiving view coordiantes
y   the y point of the event, in receiving view coordinates
于 2011-11-02T02:32:31.263 回答