iphoneuitableviewtable-footer

UITableView has blank space below, can't remove


I have a UITableView that displays some data that is read in at runtime and features a button below it that will refresh the list when clicked. All of that works fine, however there is a problem with the layout on the simulator.

When I run, there is a space at the bottom of the table that pushes the refresh button down. No matter how long the UITableView is, the UIButton will always be kept at that extended distance. If I overlay the bottom with the UIButton, it does display with slightly less padding. I am at a loss of how to fix this.

Image with example of behaviour: http://img864.imageshack.us/img864/9913/screenshot20120326at113.png


Solution

  • I think the problem is that in the interface builder your layout does not show at the same size, because it lacks the navigation bar at the top.

    In the visual editor, choose the window hosting your table view, go to the attribute inspector, and choose Navigation bar for the Top Bar entry in the Simulated Metrics section of the inspector. The layout of your design will change. Resize your table view, move your button, rebuild the app, and run it again; this should do the trick.