Changing UITableView contentOffset during device rotation

Originator:lucasneiv4
Number:rdar://11953369 Date Originated:25-Jul-2012 01:23 PM
Status:Open Resolved:
Product:iPhone SDK Product Version:5.1
Classification:Other Bug Reproducible:Always
 
25-Jul-2012 01:23 PM Lucas Neiva:
Summary:

Changing the content offset so that the currently visible cells stay visible even when the row height changes  during rotation seems broken.

Steps to Reproduce:

1. Launch the sample provided in the Simulator or on any device (See "notes:" for how to recreate the sample project).
2. Scroll to the bottom of the table view so that row 58 is at the top of the screen.
3. Turn the device to landscape and back to portrait.

Expected Results:

Row 58 is still at the top of the screen.

Actual Results:

The table view has jumped to row 31.

Regression:

The calculations are correct, since setting the offset at a later time (after the rotation) brings the table view to the right location. The table view seems to override the offset during the rotation.

The weird thing is that the offset correction works above row 30. So rotating while cell 12 is visible for example works fine.

The table view should be able to do all those calculation by itself. Why do I have to tell it to change the content offset anyway? It knows how tall the rows are and should be able to see the change and keep the cells visible, right? Maybe I'm overlooking something.

Notes:

how to recreate the sample project.
1. Set up a UITableViewController that return a bigger cell height in landscape than in portrait.
2. Try to keep the cell that is currently at the top visible when rotating the device by changing the content offset of the table view content offset.

Comments

Sample Project...

can be found here: http://goo.gl/sibvE

By lucasneiv4 at July 25, 2012, 11:41 a.m. (reply...)

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!