Titanium 钛:有scrollview自动播放幻灯片
我有一个典型的createScrollableView控件。Titanium 钛:有scrollview自动播放幻灯片,titanium,titanium-mobile,Titanium,Titanium Mobile,我有一个典型的createScrollableView控件。 如何让幻灯片自己播放,而不是等待用户交互?只需在计时器函数中使用scrollToView方法即可。请尝试以下操作: var scrollableView = Ti.UI.createScrollableView({...Your initialization here...}); // Goto the next page every 1.5 seconds. // Loop around at the end setInterva
如何让幻灯片自己播放,而不是等待用户交互?只需在计时器函数中使用
scrollToView
方法即可。请尝试以下操作:
var scrollableView = Ti.UI.createScrollableView({...Your initialization here...});
// Goto the next page every 1.5 seconds.
// Loop around at the end
setInterval(function() {
var numPages = scrollableView.children.length;
var page = scrollableView.currentPage;
page = page + 1 % numPages;
scrollableView.scrollToView(page);
}, 1500);