Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-1016

ListView randomly shows blank rows on section.setItems()

    Details

      Description

      Hello.

      I have a ListView with custom ListItems. For this I use the templates as specified in the docs. When I add my custom rows to the listsection present in the listview, the listview sometimes shows blank rows instead of my own rows. The following test causes this. I added a refreshcontrol to show what happens when refreshing. Sometimes when you refresh and do setItems again, the list is fine.

      index.xml:

      <Alloy>
      	<Window class="container">
      	    <ListView defaultItemTemplate="default" top="20">
      	        <RefreshControl id="refreshControl" tintColor="#000" onRefreshstart="refreshList" /> 
      	        <Templates>
                      <ItemTemplate name="default" height="Ti.UI.SIZE" backgroundColor="#2000">
                          <View class="cell" left="2.5%">
                              <Label text="Today, 15:45" />
                              <ImageView image="appicon.png" />
                              <Label text="Title" />
                          </View>
                          <View class="cell" right="2.5%">
                              <Label text="Today, 15:45" />
                              <ImageView image="appicon.png" />
                              <Label text="Title" />
                          </View>
                      </ItemTemplate>
                  </Templates>
                  <ListSection id="listSection" />
      	    </ListView>
      	</Window>
      </Alloy>
      

      index.tss:

      "ListView":{
      	layout: 			'vertical',
      	scrollType: 		'vertical',
      	width: 				'100%',
      	height: 			Ti.UI.FILL,
      	contentHeight: 		Ti.UI.SIZE,
      	contentWidth: 		"100%",
      	horizontalWrap: 	false,
       
      },
      "ListView[platform=ios]":{
      	separatorStyle:		Ti.UI.iPhone.ListViewSeparatorStyle.NONE,
      	separatorColor:		"#000"
      }
      ".cell":{
      	width: "47.5%",
      	height: Ti.UI.SIZE,
      	layout: 'vertical',
      	top: 5
      },
      "Label":{
      	font: {
      		fontSize: 11,
      	},
      	width: "90%",
      	textAlign: Ti.UI.TEXT_ALIGNMENT_LEFT,
      	color: "#646464",
      }
      

      index.js:

      function refreshList() {
          var items = [];
          for(var i = 0; i < 15; i++) {
              var item = {};
              items.push(item);
          }
          $.listSection.setItems(items);
          $.refreshControl.endRefreshing();
      }
       
      refreshList();
      $.index.open();
      

      The blank rows dont really have a pattern where they exactly appear. Also sometimes when you scroll they dissappear or appear on random places when a blank row was already present.

      Regards,
      Patrick van Vuuren

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shossain Shak Hossain (Inactive)
                Reporter:
                Serfenia Patrick van Vuuren
              • Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code