I have a xib tableview controller and i can't get the size of the table view to shrink so that i may add additional things before the view(I would like to add some buttons). I try changing the frame in viewdidload
and viewwillappear
but nothing seams so work. I am using
self.tableView.frame = CGRectMake(0, 100, 开发者_开发问答320, 200);
but the view remains in place(just under the navigation bar). What am I doing wrong?
Why dont you resize in the xib
tableView itself? What's preventing you to do that?
EDIT: Why cant you change the height in xib
or x
and y
coordinates? Attaches image should help you do this easily in IB - (make sure to select your tableView
and open the right hand sidebar to get this menu. Once right sidebar opens goto - Size Inspector & here you can do this.
I had the same problem and i realized that my tableView was inside another TableView with its own x and y (so probably i was not able to change it). So you have to make sure that your TableView is a subview of your view or is your main view
Use a UIViewController, drag and drop a UITableView in it, resize as per your wish and there you've got what you were looking for.
精彩评论