Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1312] ScrollableView scrollend doesn't change currentPage in landscape mode

GitHub Issuen/a
ResolutionCannot Reproduce
Resolution Date2014-05-14T05:02:26.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
ReporterPatrick van Vuuren
AssigneeRitu Agrawal


On iOS, when I have my scrollable view on my screen in landscape, it doesn't set the current page sometimes of the scrollable view when the 'scrollend' event is fired. Every 4 seconds I let my scrollableview scroll to the next view. This is done by executing scrollableView.scrollToView(scrollableView.currentPage+1). Before executing scrollToView the current page is for example 2, when the scrollend event is fired, the current page is still 2, by checking the e.currentPage of the event. Log: [INFO] : Before Scroll - CurPag: 0 [INFO] : Scrollend - CurPag: 1 [INFO] : Before Scroll - CurPag: 1 [INFO] : Scrollend - CurPag: 2 [INFO] : Before Scroll - CurPag: 2: [INFO] : Scrollend - CurPag: 2


  1. Patrick van Vuuren 2014-05-12

    Also when scrolling to the end, when I have 5 views attached, I can scroll to page 5 (4 as index), but the currentPage attribute remains a maximum of 4 (3 as index). Has this something to do with the width of the views?
  2. Ritu Agrawal 2014-05-12

    Please provide a simple runnable test case and we would be happy to investigate the issue further.
  3. Patrick van Vuuren 2014-05-13

    Hey Ritu, Well I would love to, but when running a simple test case (See below, Alloy), it functions correct. function doClick(e) { alert($.label.text); } (function(){ var view1 = Ti.UI.createView({ backgroundColor: 'red' }); var view2 = Ti.UI.createView({ backgroundColor: 'green' }); var view3 = Ti.UI.createView({ backgroundColor: 'blue' }); var view4 = Ti.UI.createView({ backgroundColor: 'yellow' }); var scrollableView = Ti.UI.createScrollableView({ showPagingControl: false, left:"1%", top:"7%", width:"98%", height:"44%", views: [ view1, view2, view3, view4 ] }); scrollableView.addEventListener('scrollend', function (e) { Ti.API.info('direct: ' + e.currentPage + ' : ' + JSON.stringify(e)); Ti.API.info('scrollableView: ' + scrollableView.currentPage); Ti.API.info('scrollableView get: ' + scrollableView.getCurrentPage()); Ti.API.info('source: ' + e.source.currentPage); Ti.API.info('source get: ' + e.source.getCurrentPage()); $.label.setText(e.currentPage + ' : ' + e.view.backgroundColor); }); scrollableView.addEventListener('scroll', function (e) { Ti.API.info('direct: ' + e.currentPage + ' : ' + JSON.stringify(e)); }); $.container.add(scrollableView); })(); $.container.open(); This topic on the Q&A page explains a bit the issue. http://developer.appcelerator.com/question/147647/ios-scrollableview-currentpage-index-issue I've tried their test cases and they work fine in a new mobile application. So, at the moment, I cannot reproduce the issue with a simple test case.
  4. Ritu Agrawal 2014-05-14

    Resolving this ticket as you cannot reproduce it with a simple test case. Let us know if you put together a test case to demonstrate this issue and we would be happy to reopen this ticket.

JSON Source