I am currently trying to remove the top or bottom view from my tableview but the size of the whole tableview isnt just right. Here is what i did so far.
-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if(foo){ [self.topView setHidden:YES]; // or [self.topView removeFromSuperview]; // or [self.topView setFrame:CGRectMake(0, 0, 0, 0)]; } }
For example if i remove the view from superview the topview isnt available anymore but there is a big gap on top .. how can i remove this top view from my tableview without having this gap ?
I put some Screenshots to describe my Problem:
If you put it inside the tableview it is probably the tableHeaderView. Try this:
self.tableView.tableHeaderView = nil;
Should remove the view and update the tableview accordingly.
[self.tableview reloadData]
删除topview后,或者如果您使用自动布局,则可以使用[self.view updateConstraints];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.