Titaniumを使用してAndroidアプリを開発しています.titaniumのtableviewにtouchstartとtouchendイベントを適用したい.私は次のコードを試しました:
var userWin = Ti.UI.currentWindow;
var data = [];
for (var i=0;i<5;i++)
{
var row = Ti.UI.createTableViewRow({height:'auto',className:"row"});
var username = Ti.UI.createLabel(
{
text:'user name',
height:'auto',
font:{fontSize:12, fontFamily:'Helvetica Neue', color:'#000'},
width:'auto',
color:'#000',
textAlign:'left',
top:0,
left:35,
});row.add(username);
var imageView = Ti.UI.createImageView(
{
image:'../images/user.png',
left:0,
top:0,
height:25,
width:25
});row.add(imageView);
}
usertable_table.setData(data);
userWin.add(feed_table);
userWin.addEventListener('touchstart', function(e){
alert(e.x);
// Ti.API.debug(['row touchstart', e]);
});
テーブルの行をクリックしても、ポップアップは表示されず、タッチスタート イベントは適用されません。 、出力を提供します。しかし、テーブルビューまたはテーブルビューの行に適用すると、機能しません。実際には、テーブルでスワイプイベントを試みていますが、それも機能しないため、touchstart および touchend イベントを試しました。この問題を解決する方法はありますか。