Search bar isn't properly hidden when estimatedRowHeight is set to a fixed number

Originator:ryanjm
Number:rdar://25351019 Date Originated:24-Mar-2016
Status:Open Resolved:
Product:iOS Product Version:9.3
Classification:UI Reproducible:Always
 
Summary:
In the additional notes section below I've linked to my github project which nicely formats the various conditions that I'm talking about here. It can also be found in the README of the project zip I attached.

The issue is that UITableViewController (or UIScrollView) isn't allowing the contentOffset to be properly used when (1) the estimatedRowHeight is set to a fixed number (as opposed to UITableViewAutomaticDimension) and (2) there aren't enough cells on screen to fill the entire display.

I'm trying to hide the search bar above the navigation controller until the user pulls down on it (just like the Mail app). I'm setting the contentOffset and that works almost all the time except in the case that there aren't enough cells to fill the screen.

Additionally, in my project I'm using custom cells and to have them layout properly I have to set a fixed height for estimatedRowHeight in order for auto layout to properly lay them out.

Therefore I think there is one, possibly two, bugs (my main concern and this radar is for the first one):

1. ScrollView doesn't behave properly when the contentOffset is set, there aren't enough cells to fill the screen, and a fixed height is being used for estimatedRowHeight.
2. Autolayout isn't properly laying out custom cells when estimatedRowHeight is set to UITableViewAutomaticDimension.

Steps to Reproduce:
1. Compile app for iPhone 6 (this is just to make sure the screen is small enough to see the formatting issues)

Problem 1:
2. Click on "Basic Cells" > "Few w/o automaticDimension..."

Problem 2:
3. Go back and click on "Custom Cells" > "Few w/ automaticDimension"

Expected Results:
Problem 1: Expected the search bar to be hidden

Problem 2: Expected text in the last cell to be wrapped

Actual Results:
Problem 1: Search bar is displayed

Problem 2: Text in the last cell is cut off at one line

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!