[AC-1016] ListView randomly shows blank rows on section.setItems()
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2015-09-17T07:59:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | TCSupportTriage, blank_rows, custom_template, listsection, listview, template, titanium |
Reporter | Patrick van Vuuren |
Assignee | Shak Hossain |
Created | 2014-09-25T13:53:38.000+0000 |
Updated | 2016-03-08T07:37:21.000+0000 |
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
This issue still persists in iOS 8 / Ti SDK 3.4.0 / Alloy 1.5.0. Is it possible this issue could be looked at? The rows are actually there but not visible. It's not like there is actually no row. I also made a video ([https://vimeo.com/105630553]) for my application to see whats happening.
Is anyone looking at this? It is a serious issue in my iOS application that is already live.
I have this issue as well and it disappears when I remove:
It only reproduces on devices, about 8 out of 10 times. [~mpmiranda] [~ingo] could you have a look at this? The workaround is to not use
separatorColor
instead and set it to the backgroundColor of the list items. This issue seems to be the same as TC-4126Hello Fokke, Thanks for finding out the problem. If I define the backgroundColor to white and leave the seperatorStyle/seperatorColor black it is fixed? Regards, Patrick
[~Serfenia] just don't use
seperatorStyle
and instead useseperatorColor
to hide the line by giving it the same color as theListItem
'sbackgroundColor
ortransparent
.Thanks Fokke Zandbergen, I can verify that works as a solution. Ti SDK 3.4.1 Alloy 1.5.1 iOS 8.1
.
I can confirm, that in 3.5.0 the problem exists. here's a screenshot: http://cl.ly/image/0w2B3v1z3S0A
I am unable to reproduce this problem using the test app included in the description on this ticket. I also cannot reproduce the issue on the linked ticket. Tested with TiSDK 3.5.0.GA and 4.0.0 (master build) Alloy 1.5.1, 1.6.0-dev, and 1.7.0-dev iOS 8.1 simulator Two different Macs (core i7 w/16g and core i5 w/8g)
It's reproducible with childTemplates mixed horizontal and vertical layouts
[~benutzername] can you please add a test case?
Sorry, I deleted all my work with specific layouts and refactored it. I will have a look if I can create a simple one
I see the same behaviour on 4.1, it seems to be random