This commit is contained in:
Martin Barreto 2015-08-18 20:14:41 -03:00
parent 033b6561fe
commit 93d8581557
2 changed files with 18 additions and 3 deletions

View File

@ -50,6 +50,16 @@ NSString *const kCellIdentifier = @"PostCell";
[self.tableView registerClass:[PostCell class] forCellReuseIdentifier:kCellIdentifier];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

View File

@ -106,12 +106,12 @@
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
_lastSize = self.containerView.bounds.size;
}
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
_lastSize = self.containerView.bounds.size;
[self updateIfNeeded];
}
@ -285,8 +285,13 @@
-(void)updateContent
{
if (!CGSizeEqualToSize(_lastSize, self.containerView.bounds.size)){
_lastSize = self.containerView.bounds.size;
[self.containerView setContentOffset:CGPointMake([self pageOffsetForChildIndex:self.currentIndex], 0) animated:NO];
if (_lastSize.width != self.containerView.bounds.size.width){
_lastSize = self.containerView.bounds.size;
[self.containerView setContentOffset:CGPointMake([self pageOffsetForChildIndex:self.currentIndex], 0) animated:NO];
}
else{
_lastSize = self.containerView.bounds.size;
}
}
NSArray * childViewControllers = self.pagerTabStripChildViewControllers;
self.containerView.contentSize = CGSizeMake(CGRectGetWidth(self.containerView.bounds) * childViewControllers.count, self.containerView.contentSize.height);