[ALOY-1229] iOS: ListView filling template incorrectly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2015-02-06T19:10:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.7.0 |
Components | Tooling, XML |
Labels | ios, listview, listview,, listviewitem, sdk |
Reporter | Thomas Wilkinson |
Assignee | Tim Poulsen |
Created | 2014-08-13T16:47:23.000+0000 |
Updated | 2015-02-06T19:10:36.000+0000 |
Description
The ListView is not filling out incorrectly. The first label "#faultyLabel" should be replace with text and have a backgroundColor="magenta", but what's happening is a new label is appearing behind the next line, with its backgroundColor="magenta" and the text either not displayed or displayed out of view.
Create a new Alloy project and drop the three attached files to see the issue. The ListView works correctly in Android (screenshot also attached)
Attachments
File | Date | Size |
---|---|---|
index.js | 2014-08-13T16:47:23.000+0000 | 1218 |
index.tss | 2014-08-13T16:47:23.000+0000 | 553 |
index.xml | 2014-08-13T16:47:23.000+0000 | 591 |
listview-android.png | 2014-08-13T16:51:47.000+0000 | 127366 |
listviewissue.png | 2014-08-13T16:47:23.000+0000 | 201657 |
Screen Shot 2015-02-06 at 1.59.46 PM.png | 2015-02-06T19:08:14.000+0000 | 71675 |
Ok, I just found a workaround to this very oddly specific defect. Here’s the snippet:
And in the TSS:
Here’s what I did: 1) I removed the wrapper view
The client has requested this be fixed in the next or next-to-next SDK release.
[~twilkinson] Is it possible to get a non-Alloy test case for this?
Besides grabbing the compiled code from the Resources directory? I should have some bandwidth at the end of this week.
Yes, the compiled code can be difficult to review. If you can simplify it, that would be great.
The issue seems to be related to the usage of the 'touchEnabled' property on the parent View inside the ItemTemplate.
Just by removing "touchEnabled=false" from id="outerView" View in index.html, it's then being displayed fine also on iOS. Further investigation results:1.
See the following modified version of index.xml. I have set a touchEnabled="false" in the top view in the ItemTemplate (the one with id="outerView"), as well as added a custom property and layout="vertical" :In this case the compiled
In this case, the bindId: "faultyLabel" and other properties (customProp="foobar" layout="vertical" touchEnabled="false") are also applied to the children objects of the top view in the ItemTemplate.
2.
In the compiled code, also, bindId is being set inside the "properties" in the object and it seems this is the value being used when building on iOS (hence the issue reported originally in the ticket). About this, see how the "otherViewLabel2" is being compiled:is compiled as
In this case there are two "bindId" , one in the properties and one outside of it. In this case the one outside is correctly
3.
Use the following index.html (removed touchEnable="false" from the parent View and added back touchEnabled="false" in all view children objects)Compiled code is now:
< bindId: "faultyLabel" > is only present in the Label with id="faultyLabel" (although still present twice, both inside and outside the object properties).
I can confirm the issue with Alloy 1.5.1 and Alloy 1.6.0 (not yet released). However, with Alloy 1.7, the sample app attached renders correctly. See the attached screen. Looking at the tickets in 1.7, I'm not completely sure which one would have resulted in fixing this issue. Perhaps ALOY-1127. I'm going to resolve this ticket for now. Please reopen if you're still seeing the issue with the Alloy 1.7 version.