UITableView scrollRectToVisible:animated: doesn't work while table is scrolling
| Originator: | juri.pakaste | ||
| Number: | rdar://15391357 | Date Originated: | 05-Nov-2013 10:19 AM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0.3 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
scrollRectToVisible:animated:, inherited by UITableView from UIScrollView, doesn't work if the table view is already scrolling.
Steps to Reproduce:
1. Create an UITableView with UITextFields in the cells, one above where the keyboard's top will appear, one below
2. Add a footer to the table
3. Set the UITableView's contentInsets so you can scroll the whole thing properly while the keyboard is on screen
4. Configure the first UITextField's return button to call becomeFirstResponder on the second field
5. Make the second UITextField's UIControlEventEditingDidBegin call scrollRectToVisible:animated: on the footer's frame
6. Focus the first UITextField while the second one is off-screen
7. Press return to move to focus to the next UITextField
Expected Results:
The footer should become visible when the focus moves to the second text field.
Actual Results:
Only the second text field becomes visible.
Notes:
This does not occur if the second text field is already visible when becomeFirstResponder is called. So if becomeFirstResponder doesn't cause scrolling, the explicit scrolling works. If you add dispatch_async(dispatch_get_main_queue() ^{}) around the scrollRectToVisible:animated:, the scrolling works regardless of the visibility of the fields.
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!