From 14789cd9079daad3d3b78d841768a4ff2767e663 Mon Sep 17 00:00:00 2001 From: Tom Thorpe Date: Sat, 20 Sep 2014 16:49:57 +0100 Subject: [PATCH] fixing bug where the optional bar/line under the top scroller wouldn't resize with the view's width when the device was rotated into landscape --- .../Source/TTScrollSlidingPagesController.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UIScrollViewSlidingPages/Source/TTScrollSlidingPagesController.m b/UIScrollViewSlidingPages/Source/TTScrollSlidingPagesController.m index e8e662d..48cdb40 100644 --- a/UIScrollViewSlidingPages/Source/TTScrollSlidingPagesController.m +++ b/UIScrollViewSlidingPages/Source/TTScrollSlidingPagesController.m @@ -139,8 +139,10 @@ - (void)viewDidLoad [self.view addSubview:topScrollViewWrapper]; //put the wrapper in this view. nextYPosition += self.titleScrollerHeight; + //line underneith the top scroller UIView *barView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(topScrollViewWrapper.frame) - self.titleScrollerBottomEdgeHeight, CGRectGetWidth(topScrollViewWrapper.frame), self.titleScrollerBottomEdgeHeight)]; barView.backgroundColor = self.titleScrollerBottomEdgeColour; + barView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; [topScrollViewWrapper addSubview:barView]; [topScrollViewWrapper bringSubviewToFront:barView]; }