Self-Sizing Cells Cause Visual Issues With Table View Scrolling APIs
| Originator: | mliberatore09 | ||
| Number: | rdar://26813025 | Date Originated: | 6/15/2016 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | 9.3 |
| Classification: | UIKit | Reproducible: | Always |
Summary: When using self-sizing cells with Auto Layout, attempting to scroll with UITableView APIs (e.g. scrollToRowAtIndexPath(_:atScrollPosition:animated:)) causes visual issues such as scrolling away from the target location and back again. Similarly, attempting to insert/update rows using the beginUpdates() / endUpdates() APIs causes the table view to scroll needlessly when using self-sizing cells. Steps to Reproduce: 1. In the sample project, tap the Scroll To Bottom bar button item. 2. Repeat step 1, and notice that despite scrolling to the cell which is already on screen, the table view scrolls up first, and then down. 3. Continue repeating step 1 until the problem described in step 2 stops. 4. Tap the Add Row bar button item and observe the table view scrolling despite the fact that no scrolling APIs were called. 5. Disable self-sizing cells by commenting out lines 33 and 34 in ViewController.swift and attempt to repeat the steps above, observing that the buggy behavior is not present. Expected Results: When self-sizing cells are enabled, the table view should not exhibit the scrolling issues described in steps 2, 3, and 4. The behavior should be the same as when self-sizing cells are not enabled. Actual Results: When self-sizing cells are enabled, it takes many attempts to call scrollToRowAtIndexPath(_:atScrollPosition:animated:) to scroll to an already-onscreen cell before the API has no visual effect. Also, inserting rows with self-sizing cells enabled causes unexpected scrolling to occur. Version: iOS 9.3 (13E230) Notes: Additional link to sample project: https://www.dropbox.com/s/nvezvozxfj45ri3/ScrollToBottom.zip?dl=0 Configuration: All Modern iOS Devices
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!