Open yuedong56 opened 9 years ago
This is very annoying...
I fixed it with this kinda spaghetti code :
// MenuTableViewController.m
@interface MenuTableViewController (){
BOOL firstTimeOpen;
}
@end
@implementation MenuTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
//...
firstTimeOpen = YES;
}
-(void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
if (firstTimeOpen) {
[self.tableView setContentInset:UIEdgeInsetsMake(64.0, 0, 44.0, 0)];
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
firstTimeOpen = NO;
}
}
//...
@end
still waiting for fix ...
@maxgribov thx for your answer.
by the way, we can skip this code:
[super viewDidLayoutSubviews];
because original method viewDidLayoutSubviews - do nothing. So it must be:
-(void)viewDidLayoutSubviews {
if (firstTimeOpen) {
[self.tableView setContentInset:UIEdgeInsetsMake(64.0, 0, 44.0, 0)];
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionTop];
firstTimeOpen = NO;
}
}
I am experiencing this as well....and yes...it is annoying. I also have weird jumping behaviour when using the pan gesture. Using the left button bar does it once but the pan gesture misaligns the view each time.
First time u click the left button to show the leftViewController(not drag the screen),there is a problem that the left view controller will drop down 20 px without animation.