[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] scrolls past the content when UITableViewAutomaticDimension

Originator:poppoppop
Number:rdar://21859811 Date Originated:16-Jul-2015 09:14 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.0
Classification:UI/Usability Reproducible:Always
 
Summary:

If a tableView uses estimatedRowHeight and UITableViewAutomaticDimension, scrollToRowAtIndexPath:atScrollPosition:animated will 
not always scroll to the correct location in the tableview.

Steps to Reproduce:

1. Begin in portrait orientation
2. Create a table with lots of cells. 
3. Provide an `estimatedRowHeight` and set `rowHeight` to `UITableViewAutomaticDimension`
4. Call `scrollToRowAtIndexPath:atScrollPosition:animated` to go to the last cell
5. Rotate to landscape
6. Call `scrollToRowAtIndexPath:atScrollPosition:animated` to go to the first cell

Expected Results:

This should be the same as tapping the status bar, you should be at the top of the table.

Actual Results:

If the total for all estimated heights is > actual heights, we zoom past the beginning and get a blank screen. 
    
If `animated` is NO, it behaves as expected.


Notes:
Sample project available at https://github.com/prendio2/estimatedRowHeightFail

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!