[TIMOB-17572] iOS: ActivityIndicator does not reset when used in ListView
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-01-23T19:24:34.000+0000 |
Affected Version/s | Release 3.3.0, Release 5.1.0, Release 5.0.0, Release 5.1.1 |
Fix Version/s | Release 7.0.2 |
Components | iOS |
Labels | merge-7.0.2, regression, supportTeam |
Reporter | Thomas Wilkinson |
Assignee | Hans Knöchel |
Created | 2014-08-28T21:28:38.000+0000 |
Updated | 2020-12-05T21:47:40.000+0000 |
Description
A template in a ListView includes an ActivityIndicator. The first time the activity indicator appears, its spinner works fine but the second and subsequent time it appears, the spinner does not work.
Steps to reproduce:
(1) Create a new Alloy project and drop the three attached files into their usual folders and run the project on an iPhone or iOS Simulator.
(2) Scroll to the bottom. The ActivityIndicator appears as normal for a second, until it's replaced with more ListItems.
(3) Scroll to the bottom again. Now the ActivityIndicator is sans-spinner. Every subsequent scroll will have the same results.
It appears that this is because the ActivityIndicator view is not properly resetting when removed from the ListView. When I set visible=false to the ActivityIndicator before removing it from the view, the spinner works ok. Unfortunately this requires editing a ListView which is an expensive operation. You can see the workaround in action by uncommenting line 95 of the example code.
Note that the word "Loading" (also part of the ActivityIndicator) does appear even though the spinner does not.
Attachments
File | Date | Size |
index.js | 2014-08-28T21:28:38.000+0000 | 2406 |
index.tss | 2014-08-28T21:28:38.000+0000 | 870 |
index.xml | 2014-08-28T21:28:38.000+0000 | 733 |
a small bug ..but no one fix..
Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6691
Is there any reason why this is slated for a 4.1.0 release? Couldn't it be included with the 3.5.2 updates coming up? For now I will cherrypick the change myself, but i'd rather not in the near future.
Verified the fix. The activity indicator now resets as expected. Tested using the attached app files. Closing. Environment: Appc Studio : 4.1.0.201505071004 Ti SDK : 4.1.0.v20150605164428 Ti CLI : 4.0.1 Alloy : 1.6.0 MAC Yosemite : 10.10.3 Appc npm : 4.0.0 Appc CLI : 4.0.2-rc2 Node: v0.10.37 IOS simulator: Iphone 5 IOS 8.3
This doesn't work correctly. While the indicator is properly visible the animation is stopped. I tested this in 4.0.0.GA (cherry picked the change) and the latest 4.0.1.
I also confirmed that this is not working in the latest 4.1.0 beta.
I have spent more time than I care to admit trying to resolve this problem. It is not limited to scrolling. If you use
setSections
to setup a list view containing one list section with one list item that uses an activity indicator, callingsetSections
again with exactly the same list section causes the activity indicator to stop animating. There may be a missing[indicatorView startAnimating];
call somewhere inTiUIActivityIndicator.m
, or perhaps there is a problem with the way cells are displayed or refreshed inTiUIListView.m
, but I haven't been able to work it out. In the meantime, here is a workaround to ensure that visible activity indicators continue animating: only make changes to the list view and list sections using methods that calldispatchUpdateAction
instead ofdispatchBlock
. So, you can update the list view usingappendSection
,insertSectionAt
,deleteSectionAt
andreplaceSectionAt
, but do not usesetSections
. You can only update list sections usingsetItems
,updateItemAt
and the other list section methods if you specify an animation. Activity indicators will stop animating if you use those methods without specifying an animation.This is not working in SDK 5.0.0.GA, iOS 8.4 My ListView use ActivityIndicator with data binding After data updated, the ActivityIndicator stop animated
Is there any update on this bug? It still seems to be broken.
[~sdarda], can you please provide a test case that runs in an single app.js so we can test and debug it through Xcode directly?
[~ewieber] Can you try to reproduce this and report back please?
I am able to see what [~jamesk.au] and [~sdarda] have reported. When adding items to the listview, the activity indicator stops spinning, when in a list item. I can see the same behavior when using this below, Classic test case:
Actually this is a native -issue- behavior, whereby the native
UITableView
stops all animations once it moves out of the view-port. [This discussion](https://stackoverflow.com/a/36793776/5537752) described the issue pretty detailed. We *may* be able to hook into ourUITableViewCell
subclass that is used for the (abstract)Ti.UI.ListItem
, but we need to try that out.PR (master): https://github.com/appcelerator/titanium_mobile/pull/9716 PR (7_0_X): https://github.com/appcelerator/titanium_mobile/pull/9717
FR passed.
FR for Master passed and merged waiting for 7.0.2 Test and other information can be found at https://github.com/appcelerator/titanium_mobile/pull/9716 (master)
Verified fix is found in: SDK 7.0.2.v20180124113923 SDK 7.1.0.v20180124115505
Unfortunately this is not fully fixed so far. See this test case: