I have a tableview with frame size of(0, 65, 320, 503).When i navigate to another page then i come back it move down.


I have a tableview with frame size of(0, 65, 320, 503).When i navigate to another page then i come back it move down.


add the below line in your - (void)viewDidLoad method.
self.automaticallyAdjustsScrollViewInsets = NO;
hope it will fix your issue.
I hope you found a solution that worked for you. This was happening to me when using AutoLayout and UITableViews combined with the wonderful SWRevealViewController class. Long story short I wasted a bunch of time and eventually found this answer that worked for me:
https://stackoverflow.com/a/23021157/892990
I moved my UITableView to a lower position in the view hierarchy (by putting a dummy 1pt-thick spacer UIView between it and the Top Layout Guide), and now it behaves as expected.
Place this code in view will appear,
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
self.edgesForExtendedLayout = UIRectEdgeNone;
}
[self.navigationController.navigationBar setTranslucent:NO];
and also try removing auto layouts.
Hope this helps...
I think you need to set frame of tableview in viewWillAppear method again because some way in your code you r changing the frame so just set it in viewwillappear .
Try this in your viewWillAppear
[your_tableview removeFromSuperview];
[your_tableview setTranslatesAutoresizingMaskIntoConstraints:YES];
your_tableview.frame = CGRectMake(0, 65, 320, 503);
[self.view addSubview:your_tableview];
You could also try this if you don't want to use the header section
your_tableview.tableHeaderView = nil;
if you are using storyboard.
1>set Navigation bar's translucent property to NO. Adjust your subviews frame again because after setting its NO ,the subview will be adjusting with some new frames.
2> In viewDidLoad set the following
self.automaticallyAdjustsScrollViewInsets = NO;
3> its done.