Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display tableView under status bar

I'm trying to display my UITableView's content under the status bar upon app launch (it can be achieved now by scrolling).

This is my current result:

enter image description here

But I'd like it to appear like this:

enter image description here

I've set these attributes for the UINavigationController

enter image description here

And I've tried to adjust the insets like so in viewDidLoad:

[self.tableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];

However, it doesn't display as desired.

like image 311
Erik Avatar asked Oct 29 '25 09:10

Erik


2 Answers

set the tableView contentInsetAdjustmentBehavior property

tableView.contentInsetAdjustmentBehavior = .never

like image 185
Alaa Eddine Cherbib Avatar answered Oct 31 '25 01:10

Alaa Eddine Cherbib


Add the code in this method- -viewDidLayoutSubview()

[self.tableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];
like image 29
Vizllx Avatar answered Oct 31 '25 01:10

Vizllx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!