0

Using Titanium Appcelerator SDK 1.7.1 for iOS 4.3

TableViewRowがあり、2つのボタンを表示できるように、(デフォルトの編集可能な削除ではなく)カスタムスワイプイベントを発生させる必要があります。1つは行を完了としてマークし、もう1つは行を削除します。

問題は、明らかにスワイプイベントが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 に答える