Operating System
Name = Mac OS X
Version = 10.10.4
Architecture = 64bit
# CPUs = 8
Memory = 17179869184
Node.js
Node.js Version = 0.10.38
npm Version = 1.4.28
Titanium CLI
CLI Version = 4.0.1
Titanium SDK
SDK Version = 4.1.0.GA
SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/4.1.0.GA
Target Platform = iphone
since the update to 4.1.0.GA, my listViews are not showing every time I open a window with a listview in iOS. Can't reproduce it. It's absolute randomly. I'm coming from 4.1.0.v20150516202834 where it works as normal.
I posted it into the community and [~fokkezb] confirms this bug:
https://community.appcelerator.com/topic/2513/4-1-0-ga-now-available/14
I think I can workaround this bug while giving explizit height in the properties. So far in my testing, the problem doesn't appear anymore.
var win = Ti.UI.createWindow();
var itemTemplate = {
properties: {
// These are the same as the list data item properties
// The list data item properties supersedes these if both are defined
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE
},
childTemplates: [ // Add view subcomponents to the ListItem
{
// Display a Label
type: 'Ti.UI.Label',
// If there is a rowtitle dictionary in the ListDataItem,
// that data binds with this view subcomponent
bindId: 'rowtitle',
properties: {
// Set view properties for the Label view subcomponent
font: {fontSize: '14dp'}
},
childTemplates: [
// View subcomponents can also have subcomponents
]
}
// ...add more components
]
};
// Simplest list data items that can be displayed in a list view
var data = [
{
properties: {
height: 44
},
rowtitle: {
text: 'Row 1'
}
},
{
properties: {
height: 44
},
rowtitle: {
text: 'Row 2'
}
},
{
properties: {
height: 44
},
rowtitle: {
text: 'Row 3'
}
}
];
var data1 = [
{
properties: {
height: Ti.UI.SIZE
},
rowtitle: {
text: 'Row 1'
}
},
{
properties: {
height: Ti.UI.SIZE
},
rowtitle: {
text: 'Row 2'
}
},
{
properties: {
height: Ti.UI.SIZE
},
rowtitle: {
text: 'Row 3'
}
}
];
// works
//var listSection = Titanium.UI.createListSection({items: data});
// works randomly not
var listSection = Titanium.UI.createListSection({items: data1});
// Add the list section to a list view
var listView = Titanium.UI.createListView({
sections: [listSection]
});
var listView = Titanium.UI.createListView({
sections: [listSection],
templates: {
default: itemTemplate
},
defaultItemTemplate: 'default'
});
win.add(listView);
win.open();
I can only [find](https://github.com/appcelerator/titanium_mobile/commits/0ff8c6818ca7a1b1cd0da18c11c60bab00ccb423/iphone/Classes) one relevant commit since 20150516 if at that time it was indeed still working like [~benutzername] says: https://github.com/appcelerator/titanium_mobile/commit/304c4d1cf2ba6c4109cf76973846cef6ce29f334
I'm having problems on a ListView, maybe related to this ticket. On a view I have some elements (labels, ..) and a ListView. If the ListView is there, nothing is visible (blank page), if I comment the ListView everything works fine.
I confirm the blank ListView special when I run a clean build. Related with Ti.UI.SIZE and Int. normal values
We are also experiencing this. I will add, when run on iOS 7 it seems to happen far less frequently, on iOS 8 it is very common.
Having the same issue. Only after upgraded to 4.1.0. Please fix asap. Thanks.
Same issue here, although it happens for both dynamic and static height items in my case.
I am seeing the same results as Velan Vijatovic.
I am also seeing the same issue on 4.1.0 GA....its doesnt happen on 4.0.0GA
Same problem, but also with static height (since 4.1.0.GA, 4.0.0.GA works fine). Also, when I remove the listView from his parent container, rebuild/add it again, it doesn't seem to disappear.
I created a sample video of the issue, as this can be ridiculously hard to recreate sometimes: https://www.youtube.com/watch?v=vDyStdRbqO0&feature=youtu.be As it's so random, I found the easiest way to reproduce it is to create two windows, each with a listview, calling eachother on itemclick, so you can keep recreating the listviews over and over until the bug finally happens. Happy to share sample project if needed. I'll note that I use two item templates on each listview - I couldn't get the bug to trigger with only one template, but this could just be down to the seemingly random nature of the bug.
Why is this planned for 4.3.0 instead of 4.1.1 ?
Please understand the ListView is just randomly not showing on iOS, without conditions (not because of dynamic item height, etc.). So this is urgent. I can't release any update with 4.1.0 because of this bug. Is 4.3.0 going to be released soon?
I have the same problem. In my app every ListView works the most of the times and sometimes it remains blank. In some I append blocks of data scrolling down (setMarker or addMarker doesn't make any difference), in some I add all data in at the beginning. Sometimes it remains blank at the first loading, sometimes I can refresh the view 20 times and it always works (but continuing soon or later it remains blank). The easiest block of code I can show you is this one: var section = $.list.sections[0]; section.deleteItemsAt(0, section.items.length); queryResult = expirationRepository.list(); section.appendItems(queryResult.map(modelToViewItemFunction));
If you inspect the ListView object when it doesn't appear, it is missing the dictTemplates property. Here is an example when the listview DOES show up:
And here is the same exact listview (No code changes) when it does not appear:
PR: https://github.com/appcelerator/titanium_mobile/pull/6983
PR for 4.1.X https://github.com/appcelerator/titanium_mobile/pull/6984
CR and FT Passed. PRs merged!
Unable to reproduce the fail case with attached sample code. I was able to reproduce with the sample code in TIMOB-19249 on 3 of 20 attempts. With SDK 4.1.1.v20150802200935 I was unable to reproduce with 40 attempts. Closing as fixed.
https://github.com/appcelerator/titanium_mobile/pull/6984 seems to have done the job. Thanks to the devs for the quick fix.
Is there a workaround for 4.1.0? Maybe a dirty hack to force the listview to draw or something? I need to go live soon... and because 4.1.1 is not released yet, this doesn't help me now :)
In the meantime you can try to use 4.1.1 continuous builds if it doesn't break your app [http://builds.appcelerator.com.s3.amazonaws.com/index.html#4_1_X].
Yeah I'm kind of reluctant to use a non GA SDK for a production build.
[~gertjans] just patch the 4.0 SDK you use with: https://github.com/appcelerator/titanium_mobile/pull/6984/files
That I can do. Works, thank you sir!