Quantcast
Viewing all articles
Browse latest Browse all 8068

ListView crashes when tap status bar

I have a ListView with about 600+ rows. Each row just has a label (for a person's name) and a checkbox image. If I scroll a little ways down then tap the iOS status bar, the expected behaviour succeeds, the list is scrolled to the top. At a certain scroll 'distance' from the top – less than half way to the bottom, tapping the status bar results in my app crashing. I can guarantee that by scrolling to near the bottom or at the bottom that tapping the status bar crashes the app. What can I do to overcome this? I see in the kitchen sink there's a long list that can successfully be scrolled to the top but I don't believe that uses a custom template/renderer as I have.

Your advice is appreciated!

JavaScript example (or see CoffeeScript version below)

({
  initListView: function() {
    var plainTemplate;
    this.allMembersListSection = Titanium.UI.createListSection({
      items: this.listViewData
    });
    plainTemplate = {
      properties: {
        selectionStyle: Ti.UI.iPhone.ListViewCellSelectionStyle.GRAY
      },
      childTemplates: [
        {
          type: 'Ti.UI.Label',
          bindId: 'fullName',
          properties: {
            font: {
              fontSize: 20
            },
            left: 50
          }
        }, {
          type: 'Ti.UI.ImageView',
          bindId: 'checkmark',
          properties: {
            width: 25,
            height: 25,
            left: 10
          }
        }
      ]
    };
    return this.listView = Titanium.UI.createListView({
      sections: [this.allMembersListSection],
      templates: {
        plain: plainTemplate
      },
      left: 85,
      defaultItemTemplate: 'plain',
      willScrollOnStatusTap: true
    });
  }
});
Same example in CoffeeScript
initListView:->
        @allMembersListSection = Titanium.UI.createListSection(items: @listViewData)
 
        plainTemplate =
            properties:
                selectionStyle:Ti.UI.iPhone.ListViewCellSelectionStyle.GRAY
 
            childTemplates:[
                type:'Ti.UI.Label'
                bindId: 'fullName'
                properties:
                    font: {fontSize: 20}
                    left: 50
            ,
                type: 'Ti.UI.ImageView'
                bindId: 'checkmark'
                properties:
                    width: 25
                    height: 25
                    left: 10
            ]
 
        @listView = Titanium.UI.createListView(
            sections: [@allMembersListSection]
            templates:
                plain: plainTemplate
            left:85
 
            defaultItemTemplate: 'plain'
 
            willScrollOnStatusTap:true
        )

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>