I have one main viewController
A with an UITabBar
. My issue are when I scroll to the last cell and after I go to the viewController
B with a cell click in UITableView
and when I come back to my viewController
A, my last cell is cut off at the bottom and I can scroll for appear all content of this cell. But by default at the bottom the UITableView
doesn't keep the same place that last time.
When I launch viewController
B I hide my UITabBar
with this code in VCB "viewWillAppear
" :
- (void)hideTabBar {
UITabBar *tabBar = self.tabBarController.tabBar;
UIView *parent = tabBar.superview;
UIView *content = [parent.subviews objectAtIndex:0];
UIView *window = parent.superview;
[UIView animateWithDuration:0.3
animations:^{
CGRect tabFrame = tabBar.frame;
tabFrame.origin.y = CGRectGetMaxY(window.bounds);
tabBar.frame = tabFrame;
content.frame = window.bounds;
}];
}
And when I come back to my viewController
A I show my UITabBar
with this code in VCB "viewWillDisappear
":
- (void)showTabBar {
UITabBar *tabBar = self._tab;
UIView *parent = tabBar.superview;
UIView *content = [parent.subviews objectAtIndex:0];
UIView *window = parent.superview;
[UIView animateWithDuration:0.3
animations:^{
CGRect tabFrame = tabBar.frame;
tabFrame.origin.y = CGRectGetMaxY(window.bounds) - CGRectGetHeight(tabBar.frame);
tabBar.frame = tabFrame;
CGRect contentFrame = content.frame;
contentFrame.size.height -= tabFrame.size.height;
}];
}
I have the same problem in iOS 6 but the scroll doesn't allow to go at the bottom and the last cell are cut off always.
In my viewController
A in "viewWillAppear
" I do:
if ([[UIDevice currentDevice].systemVersion hasPrefix:@"7"]) {
[self._tabBarControllerArticle.tabBar setTranslucent:NO];
}
- Before when I clicked (image 1)
- When I come back (image 2)
Thanks for advance for all the answer!!!