Michal
Michal

Reputation: 15669

Strange behavior of Table View Controller

I am having some rough times with table view controller in iOS7. My app has a root view controller Navigation Controller and in that I have a Tab Bar Controller and in that Table View Controller (one of the tabs). Now iOS7 has that special feature that the view is behind it, while the navigation item is semi transparent. Although I am having a difficulty making its' behavior united. When the view appears - it is behind the navigation bar. BUT when I minimize the app to iOS homescreen and then switch it back on from multi tasking - the table view suddenly is NOT ANYMORE behind the navigation bar. I am not setting the frame of the view in any way such as...self.tableView.frame etc...

EDIT: When I manually add this line:

self.tableView.frame = CGRectMake(self.view.frame.origin.x, 64, self.view.frame.size.width, self.view.frame.size.height - 64);

I get the RIGHT thing when it appears, BUT when I minimize it - bring it back, it jumps down AGAIN and creates a white gap between the bar and the table (only once though...).

Is this a bug of iOS7 or I'm getting something terribly wrong?

Before After

Upvotes: 1

Views: 169

Answers (1)

Chamira Fernando
Chamira Fernando

Reputation: 6846

try this in viewDidLoad method

self.navigationController.navigationBar.translucent = NO;

Upvotes: 1

Related Questions