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

iOS: ScrollableView + run-on-main-thread - views dont render until scroll when re-adding views

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 7.1.1, Release 7.2.0
    • Fix Version/s: Release 7.5.0
    • Component/s: iOS
    • Environment:
    • Story Points:
      0
    • Sprint:
      2016 Sprint 17 SDK

      Description

      When enabling

      <property name="run-on-main-thread" type="bool">true</property>

      ScrollableView does not render views when re-adding views to the ScrollableView until you scroll a bit then they suddenly render.

      When removing `run-on-main-thread` it works just fine.

      Steps to reproduce:
      1. Create new alloy project
      2. In your index.js add the code below
      3. Build to ios simlulator
      4. Scroll to see everything is working
      5. Click on re-add views button - See that views are now all white / not rendered
      6. Scroll left or right and see that the views then render
      7. Remove run-on-main-thread from tiapp.xml and build and see that everything works fine.

      function reAddViews(){
      	oldViews = scrollableView.views;
      	scrollableView.views = oldViews;
       
      	// ANOTHER TEST TO PROVE ONLY NEWLY CREATED VIEWS WORK
      	//var view3 = Ti.UI.createView({ backgroundColor:'orange'});
      	//scrollableView.views = [oldViews[0],oldViews[1],view3,oldViews[3],oldViews[4]]
       
      	scrollableView.currentPage = 2;
      }
       
      var button = Titanium.UI.createButton({
         title: 'Re-Add Views',
         bottom: 10,
         height: 50,
      });
      button.addEventListener('click',reAddViews);
      $.index.add(button);
       
      var view1 = Ti.UI.createView({ backgroundColor:'red'});
      var view2 = Ti.UI.createView({ backgroundColor:'blue'});
      var view3 = Ti.UI.createView({ backgroundColor:'yellow'});
      var view4 = Ti.UI.createView({ backgroundColor:'green'});
      var view5 = Ti.UI.createView({ backgroundColor:'pink'});
       
      var scrollableView = Ti.UI.createScrollableView({
        views:[view1,view2,view3,view4,view5],
        showPagingControl:true,
        bottom: 50,
        currentPage:2,
        cacheSize: 9,
      });
       
      $.index.add(scrollableView);
      $.index.open();
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              dieskim David van de Meer
              Reviewer:
              Vijay Singh
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6422
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code