[TIMOB-20196] iOS: on ScrollableView is not possible to change views
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-01-06T21:21:11.000+0000 |
Affected Version/s | Release 5.1.1 |
Fix Version/s | Release 5.2.0 |
Components | iOS |
Labels | ScrollableView |
Reporter | Mauro Piccotti |
Assignee | Angel Petkov |
Created | 2016-01-04T17:57:25.000+0000 |
Updated | 2016-01-13T22:54:39.000+0000 |
Description
In a widget I have a ScrollableView where I need to change views. It stopped to work from version 5.1.0.
When I set the "views" property with another collection of views the app remains blocked, without any error.
I tryed other solution (like insertAt or replaceAt) but I cannot dynamically change views anymore.
The widget is this one:
https://github.com/apra-informatica/Ti.ImageGallery/blob/master/controllers/widget.js
And the code:
var index = 0;
var newView = Ti.UI.createView();
var views = $.scrollableView.views;
views[index].removeAllChildren();
views[index] = newView;
$.scrollableView.views = views;
Hello, I tested this issue. This is a valid bug in the latest SDKs. Changing ScrollableView's view stop working in SDK 5.1.0.GA and onward. In Android it's working fine though. Please follow the sample code below.
Test Environment
Cli 5.1.0 SDK 5.1.0.GA, 5.1.1.GA iOS 9.1 Android 4.4.2 This is a valid bug.I hope it's the same problem.
Reopening ticket. Need to be revisited as it may not be the same issue as the duplicate.
[~cng] It doesn't look fixed with 5.1.2. We should test the original code to be sure the issue is the same. But using the code from Sharif above, you start with 6 views, with the scollableView set to "1, 2 and 3" at first, which are dark blue, medium blue, and light blue. Clicking the button sets the scrollableView.views to views 4, 5 and 6. These are red, green, and blue. With 5.0.2 SDK, things work as expected. With 5.1.0, 5.1.1, and 5.1.2.v20151216190036, clicking the button to set the views has the scrollable view go black. When you manipulate it, the colors appear again. [~ewieber] has created a ticket for this behavior mentioned above TIMOB-20199. And he will try the code from [~pic] and comment because it may be a different issue.
PR : https://github.com/appcelerator/titanium_mobile/pull/7617 PR(5_2_X) : https://github.com/appcelerator/titanium_mobile/pull/7627 Same code as the one provided by Sharif. Just added boolean so you can keep switching between views by pressing the button.
Verified fixed, using: MacOS 10.11.2 (15C50) Studio 4.4.0.201511241829 Ti SDK 5.2.0.v20160111111831 Appc NPM 4.2.2 Appc CLI 5.1.0 Xcode 7.2 (7C68) Node v0.12.7 Java 1.7.0_80 Tested with all provided test cases/samples. I no longer see the views inside the ScrollableView "break" or go black when switching between them or sets of views.