From 1a4e16333ceef31646a2039a937114ce90c1744f Mon Sep 17 00:00:00 2001 From: Hesham Abd-Elmegid Date: Thu, 14 Aug 2014 13:38:23 +0300 Subject: [PATCH] Fixes selection indicator always appearing at bottom. --- HMSegmentedControl/HMSegmentedControl.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HMSegmentedControl/HMSegmentedControl.m b/HMSegmentedControl/HMSegmentedControl.m index d482d813..d5a42ecc 100644 --- a/HMSegmentedControl/HMSegmentedControl.m +++ b/HMSegmentedControl/HMSegmentedControl.m @@ -418,8 +418,9 @@ - (CGRect)frameForSelectionIndicator { if (self.selectionIndicatorLocation == HMSegmentedControlSelectionIndicatorLocationDown) { indicatorYOffset = self.bounds.size.height - self.selectionIndicatorHeight + self.selectionIndicatorEdgeInsets.bottom; } + if (self.selectionIndicatorLocation == HMSegmentedControlSelectionIndicatorLocationUp) { - indicatorYOffset = self.bounds.size.height - self.selectionIndicatorHeight + self.selectionIndicatorEdgeInsets.top; + indicatorYOffset = self.selectionIndicatorEdgeInsets.top; } CGFloat sectionWidth = 0.0f;