I have a table that is during odd things with its alignment. IT is a UITableView on top of a view controller.

Why is there so much distance (the green line) between the navigation bar and the first cell? And why is there a small gap between the cell and the left side off the screen (red line)? I can of course correct this with IB by dragging the TableView off screen but would rather fix this the 'right way' and understand why its doing this in the first place.
Green line: do you have a table header view? If not, what is the content inset of the table view? Either of those can introduce some extra space atop the table view.
Red line: that's how table view separators are supposed to look by default. You can change that value by updating the separatorInset property.
A nitpick: you can't have a table view "on top of" a view controller. A view controller can manage a table view as its view (especially if it's a table view controller), or you can have a table view inside (as a subview of) another view managed by a view controller. View controllers, as non-view objects, never appear directly onscreen.
You can use autosizing if you are using xib or storyboard for designing. In Interface Builder on tap "Size inspector" you can choose autoresize mask you want. Also in little square screen it will animation with using autoresize so you can see what option did you set. http://www.techotopia.com/index.php/IOS_4_iPhone_Rotation,_View_Resizing_and_Layout_Handling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With