0

I'm developing an iOS application and i'm using the SWRevealViewController, i made the side-menu by adding a TableView and everything works fine, but when i open the side-menu and scroll down, the contents(cells) are interfering with the iPhone top bar.

Please view the image below

Screenshot

Usually adding a Navigation Controller solve this problem, but i can't add one here because it's a side-menu.

How can i prevent that from happening and solve this?

Thanks in advance.

ANA
  • 282
  • 2
  • 16

2 Answers2

0

Tty to use contentInset for side menu TableView:

 - (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    sideMenuTableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
}
4esterUA
  • 285
  • 1
  • 2
  • 7
  • Did you unchecked "Adjust scroll view insets" in your SideMenuViewController inside the storyboard? – 4esterUA May 07 '15 at 11:23
  • Yes i unchecked it, and can you please elaborate about this method, can you edit your answer because i'm new to iOS – ANA May 07 '15 at 11:27
  • Updated. Paste it inside your SideMenuViewController.m – 4esterUA May 07 '15 at 11:30
  • I tried it, didn't work either, ofcourse i changed it to this : `self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);` – ANA May 07 '15 at 11:33
  • @ANA try to set y co-ordinate of UITableView to 20. – Ashok Londhe May 07 '15 at 11:36
  • @ANA There is sideMenuViewController is there set self.tableview.frame.origin.y=20. – Ashok Londhe May 07 '15 at 12:03
  • @AshokLondhe `Expression not assignable` ! – ANA May 07 '15 at 12:07
  • It's not responding at all! nothing works, i'm using iOS 7.0 by the way, what's going on ? – ANA May 07 '15 at 12:11
  • About setting frame, you could't do it directly. Use self.tableView.frame = CGRectMake(self.tableView.frame.origin.x,self.tableView.frame.origin.y + 20,self.tableView.frame.size.width,self.tableView.frame.size.height) - this shifts your tableview frame on 20 points lower. – 4esterUA May 07 '15 at 12:27
0

you can use container view instead of this. take a container view in first view and embed it with another view controller.Then put your table on second view controller.Then run your code. You can get what you want. you can adjust container view according to your need. check out this link. Hope this will help you.