For some reason, the UITableView
cuts off when on an iPhone 5. Instead of seeing the table view on the entire screen, I just see a blue background. Basically, it's behaving like I'm using a 3.5" inch screen. The only time it does work is when I set the view to "Retina 4 Full Screen" in Simulated Metrics. But the problem with that is then I have the opposite problems with 3.5 inch screens. Here are a couple of pictures (the view is currently set to "Freeform" in Simulated Metrics):
I have tried looking for similar questions, but none have helped. If it helps, I do have a MainWindow.xib. I am testing this using the iPhone 6.0 Simulator as well as an iPhone 4S 16GB. I will update this question if anything looks unclear. Any help is appreciated. Thank you.
You probably don't have the proper autoresizing masks set. Try to set the mask to just UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
.
Here's what i did. I started my xib file size as 3.5 in attributes inspector
And in my view controller i have this code, make sure you change the frame in viewDidAppear method
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if ([self hasFourInchDisplay]) {
self.myTableView.frame = self.view.frame;
}
}
- (BOOL)hasFourInchDisplay {
return ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568.0);
}
You need to resize your table, add one property autoresizingMask
.
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleHeight ;
One more thing you are adding tableView
inside mainView(self.view)
or any subView. You may have this problem.
Check Your mainView's bound and frame.
Hope this will help you.
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