Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24964

Windows: Add scrollToTop() to ScrollView

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.0
    • Fix Version/s: Release 7.0.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      2017 Sprint 22 SDK, 2017 Sprint 23 SDK

      Description

      Currently ScrollView has a scrollToBottom() method but no scrollToTop(). While this can be achieved with scrollTo(0,0) the new scrollToTop() uses FOCUS_UP to scroll to the top position in order to solve nested problems (see: https://stackoverflow.com/a/44046801/5193915)

      Example:

      var win = Ti.UI.createWindow({backgroundColor: '#fff'});
      var view1 = Ti.UI.createView({width:20,height:20,backgroundColor:"#f00",top:0});
      var view2 = Ti.UI.createView({width:20,height:20,backgroundColor:"#f0f",top:800});
      var scrollView = Ti.UI.createScrollView({height:Ti.UI.FILL,width:Ti.UI.FILL});
      var btn1 = Ti.UI.createButton({title:"scrollUp",top: 10,left:0});
      var btn2 = Ti.UI.createButton({title:"scrollDown",bottom:10,left:0});
       
      btn1.addEventListener("click",function(e){scrollView.scrollToTop()});
      btn2.addEventListener("click",function(e){scrollView.scrollToBottom()});
       
      win.add(scrollView);
      win.add(btn1);
      win.add(btn2);
      scrollView.add(view1);
      scrollView.add(view2);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                michael Michael Gangolf
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code