Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabBar will hide the last cell of the UITableView

Tags:

self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, [UIScreen mainScreen].bounds.size.height ) style:UITableViewStylePlain];

enter image description here

If I change the tableview frame to

(0.0, 0.0, 320.0, [UIScreen mainScreen].bounds.size.height -49.0)

enter image description here

the scroll bar will leave a blank,I do not like it.How can I fix this?

Thank you very much.

like image 768
jxdwinter Avatar asked Nov 01 '13 03:11

jxdwinter


1 Answers

You could try setting the contentInset of that table view. In iOS 7 there's a topLayoutGuide and bottomLayoutGuide (which is what you want). Inside of a UITabBarController the bottomLayoutGuide should give you the height of the bottom bar basically.

tableView.contentInset = UIEdgeInsetsMake(0, 0, self.bottomLayoutGuide.length, 0);

should do the trick.

like image 138
Dennis Avatar answered Nov 16 '22 16:11

Dennis