bug fix TwitterPager pageControl position
This commit is contained in:
parent
93d8581557
commit
a49fe53249
|
|
@ -60,13 +60,6 @@
|
|||
[self reloadNavigationViewItems];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
[self setNavigationViewItemsPosition];
|
||||
}
|
||||
|
||||
|
||||
-(void)reloadPagerTabStripView
|
||||
{
|
||||
[super reloadPagerTabStripView];
|
||||
|
|
@ -209,6 +202,11 @@
|
|||
}
|
||||
|
||||
-(void)setNavigationViewItemsPosition
|
||||
{
|
||||
[self setNavigationViewItemsPosition:YES];
|
||||
}
|
||||
|
||||
-(void)setNavigationViewItemsPosition:(BOOL)updateAlpha
|
||||
{
|
||||
CGFloat distance = [self getDistanceValue];
|
||||
BOOL isPortrait = UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation);
|
||||
|
|
@ -216,7 +214,9 @@
|
|||
[self.navigationItemsViews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
int index = (int)idx;
|
||||
UILabel *label = (UILabel *)obj;
|
||||
[label setAlpha:self.currentIndex == idx ? 1 : 0];
|
||||
if (updateAlpha){
|
||||
[label setAlpha:self.currentIndex == idx ? 1 : 0];
|
||||
}
|
||||
label.font = isPortrait ? self.portraitTitleFont : self.landscapeTitleFont;
|
||||
CGSize viewSize = [self getLabelSize:label];
|
||||
CGFloat originX = (distance - viewSize.width/2) + index * distance;
|
||||
|
|
@ -282,4 +282,10 @@
|
|||
return _portraitTitleFont;
|
||||
}
|
||||
|
||||
-(void)viewDidLayoutSubviews
|
||||
{
|
||||
[super viewDidLayoutSubviews];
|
||||
[self setNavigationViewItemsPosition:NO];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Reference in New Issue