Appcelerator TableViewRow 自定义滑动事件

发布于 2024-12-12 22:34:26 字数 342 浏览 2 评论 0原文

针对 iOS 4.3 使用 Titanium Appcelerator SDK 1.7.1

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

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

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

有人遇到并解决了这个问题吗?

Using Titanium Appcelerator SDK 1.7.1 for iOS 4.3

I have a TableViewRow and need to fire a custom swipe event on it (rather than the default editable delete) so that I can show 2 buttons. One marking the row as complete, the other removing the row.

The problem is that apparently the swipe event isn't allowed on the TableViewRow element.

I've tried using the Swipe event, the touchstart event and the touch move event, all with a callback of alert('woot! your finger moved!') but the callback is never fired ...

Has anybody had and resolved this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦里梦着梦中梦 2024-12-19 22:34:26

这应该有效。

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

This should work.

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

What does your code look like?

EDIT:
Do your rows have data in them? If not see if putting data in your rows help.

EDIT:
These are the events that are passed to the swipe event so you can get the row swiped with source.

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文