My Application has a navigation and UITableView. I set backgroundColor to my tableView. Look at the picture bellow. I don't understand why the first cell is not started from top of UITableView. When I use View Debbuger in Xcode, TableViewWrapperView is not fulled in UITableView.
I already searched many times. I removed check Adjust Scroll View Insets
and set .zero
tableview's contentinsets
. At last I made New Project and make it again but I can't.
How can I resolve this problem!!
enter image description here
No need to code for this issue. Just follow below simple step
YourStoryboard.storyboard > YourViewController > Attributes inspector > Uncheck - Adjust scroll view insets.
Here I attached screenshot for reference.
If you like go with code I have also solution :)
- (void)viewDidLoad {
self.automaticallyAdjustsScrollViewInsets = false
}
This is for the souls like me who tried everything above and might have missed this. I accidentally used tableview style as Grouped instead of Plain.
So set your Tableview style to "Plain" instead of "Grouped" in xib/storyboard or in code as
Objective C
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
Swift 4,0
self.tableView = UITableView(frame: CGRect.zero, style: .plain)
The table view tries to adjust itself to accommodate the navigation bar assuming that navigation bar is translucent and it has to display itself behind it.
To resolve this issue in the storyboard/xib file set the view controller property extends edges under top bar to false as shown below.
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