Light gray background in "bounce area" of a UITableView

iphone, uikit, uisearchbar, uitableview

Solution

As of iOS 7, you can tinker this by changing the tableview background view.

[self.tableView setBackgroundView:view];

make the view's background colour the same as your parent view colour.

Problem

Apple's iPhone apps such as Music and Contants use a search bar in a UITableView. When you scroll down so that the search bar moves down, the empty space above the scroll view's contents has a light gray background color (see screenshot). (Notice that the search bar has a slightly darker edge line at its top. This is not there for the default UISearchBar, but subclassing should take care of that.) I tried setting the background color of the UITableView, but that affects the rows as well. Does anyone know how to achieve this effect? Am I going to have to override implement drawRect: or is there a built in way?

Original source

Related problems