Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25332] iOS 11: ListView broken due to behavior-changes in UITableView

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-09-25T18:37:06.000+0000
Affected Version/sRelease 6.1.2, Release 6.2.2
Fix Version/sRelease 6.3.0
ComponentsiOS
Labelsn/a
ReporterDavid Fox
AssigneeHans Knöchel
Created2017-09-21T02:14:36.000+0000
Updated2017-09-25T21:13:19.000+0000

Description

I have a project with a pretty complicated ListView. Everything works as expected in iOS SDK < 11. However, when I try to run my app built with either Titanium SDK 6.1.x or 6.2.x, the ListView exhibits some very broken behavior. It seems to initially render OK, but if the code attempts to update any rows in the ListView, it starts scrolling uncontrollably and moving all over the place. Something seems to be happening with the height of the updated rows or something causing this issue. I'm not sure what was changed with the iOS ListView in the most recent iOS SDK, but I believe that's what broke it. Please let me know if you'd like any more details, thanks!

Comments

  1. Mostafizur Rahman 2017-09-21

    Hello [~dfoxinator], Thanks for sharing with us. Can you please attach the sample code to reproduce this on our end? Best
  2. David Fox 2017-09-21

    Hi Mostafizur, I'm trying to pinpoint exactly where it's failing so I can hopefully produce some sample code for you. Like I touched on, the actual ListView we use is very complex and has a lot going on so it's a bit hard to pinpoint exactly where the difference is between 6.1.x and 6.2.x. I've tried going through some recent PRs that touched iOS ListView and reverting them locally to see if the issue was fixed, but haven't had any luck. I think it potentially could be easier to do that and find the PR that's causing the behavior. Do you know if there's anywhere that I can find the PRs that touch anything remotely related to ListView, listitems, listsections, etc. that were new for 6.2.0? Thanks!
  3. Mostafizur Rahman 2017-09-21

    Hello [~dfoxinator] , Thanks for your feedback.Check the following links: [6_2_0_GA SDK Release ](https://github.com/appcelerator/titanium_mobile/releases) [titanium-sdk-6-2-0-cli-6-2-4](http://www.appcelerator.com/blog/2017/09/ga-release-of-titanium-sdk-6-2-0-cli-6-2-4/) Hope this helps.
  4. David Fox 2017-09-21

    Thanks Mostafizur. I did some more investigating and looked at the changes in 6.2.x, and I don't think that's what broke it. I tried building with 6.1.2 and iOS 11 SDK, and I still see the broken behavior. Since my ListView worked fine when build with the previous iOS SDK, I'm guessing it must be some change in iOS SDK 11 that's breaking this. I'm going to try to create a basic sample test now and see if I can get it to happen in that too.
  5. Mostafizur Rahman 2017-09-21

    [~dfoxinator] Ok. Thanks for your feedback. Please test an let us know how it goes.
  6. Hans Knöchel 2017-09-21

    Heyho, stepping in from the iOS core-team! As soon as you can wrap up a drop-in test-case (e.g. a simple app.js with one custom template reproducing this), we will move this to TIMOB and investigate it further. Thanks to support for the initial handling! *EDIT*: Reading [this article](https://medium.com/the-traveled-ios-developers-guide/ios-11-notable-uikit-additions-92e5eb421c3b), it may happen due to the estimated-row-height changes. So I think the (quite easy) fix would be to apply the following snippet after [this line](https://github.com/appcelerator/titanium_mobile/blob/6_2_X/iphone/Classes/TiUIListView.m#L246) in the {{~/Library/Application Support/Titanium/mobilesdk/osx/6.2.1.GA/iphone/Classes/TiUIListView.m:
       _tableView.estimatedRowHeight = 0;
       
    More once we have a test-case.
  7. David Fox 2017-09-21

    Hi Hans, Thanks a bunch for taking a look at this. I tried to reproduce on a bare-bones ListView app I built last night but I didn't have any luck with the most basic template. However, the great news is, I think you nailed the fix! The fix you provided seems to work like a charm and with that modification all of the broken behavior seems to disappear. I still have to test a bit more and on an actual device (the simulator did show the broken behavior too though when it was occurring) but at first glance it seems fixed. I'm not sure if you still want the sample code, which is going to take some more work to try to get breaking (and probably not worth it since it seems you already have fix) but I can continue to test and let you know what I find. Also, if it would help you and your team, I could provide a video of the behavior of the ListView in my actual app without and then with the fix. Please let me know. Thanks again and I really appreciate the quick response. I will update you tonight either way on further testing and device testing.
  8. Hans Knöchel 2017-09-22

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9465 PR (6_3_X): https://github.com/appcelerator/titanium_mobile/pull/9466 Test-Case:
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
       
       var list = Ti.UI.createListView({
         style: Ti.UI.iOS.ListViewStyle.GROUPED,
         sections: [Ti.UI.createListSection({
           items: [{ properties: { title: 'Test 1' } }, { properties: { title: 'Test 2' } }, { properties: { title: 'Test 3' } }]
         }), Ti.UI.createListSection({
           items: [{ properties: { title: 'Test 1' } }, { properties: { title: 'Test 2' } }, { properties: { title: 'Test 3' } }]
         })]
       })
       
       win.add(list);
       win.open();
       
    Expected behavior: The space between section 1 and 2 should be the same in iOS 11 and iOS < 11.
  9. Eric Wieber 2017-09-25

    FR Passed. No odd spacing or UI oddities witnessed when using or modifying a listview. Tested using the provided code as well as the ListView test suite.
  10. Eric Wieber 2017-09-25

    Verified changes in SDK builds 6.3.0.v20170925114351 & 7.0.0.v20170925115834

JSON Source