Skip to content

Commit

Permalink
Merge pull request akiroom#9 from akiroom/features/bottom-line
Browse files Browse the repository at this point in the history
Update to 0.1.5
  • Loading branch information
Hiroki Akiyama committed Jun 1, 2014
2 parents bcb16ce + 7747fd8 commit dba2461
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AXStretchableHeaderTabViewController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AXStretchableHeaderTabViewController"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "Stretchable header view + Horizontal swipable tab view."
s.description = <<-DESC
Stretchable header view + Horizontal swipable tab view
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# AXStretchableHeaderTabViewController CHANGELOG

## 0.1.5

Feature: add bottom separator.

## 0.1.4

Fix: Detect hit event in children/grandchildren of header view subviews.
Expand Down
13 changes: 12 additions & 1 deletion Classes/AXTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ @interface AXTabBar ()

@implementation AXTabBar {
NSArray *_items;
CALayer *_bottomSeparator;
CALayer *_indicatorLayer;
AXTabBarStyle _tabBarStyle;
}
Expand All @@ -34,6 +35,10 @@ - (id)initWithFrame:(CGRect)frame
_containerView.decelerationRate = UIScrollViewDecelerationRateFast;
[self addSubview:_containerView];

_bottomSeparator = [CALayer layer];
[_bottomSeparator setBackgroundColor:[[UIColor colorWithWhite:0.0 alpha:0.1] CGColor]];
[self.layer addSublayer:_bottomSeparator];

_indicatorLayer = [CALayer layer];
[self.layer addSublayer:_indicatorLayer];
}
Expand Down Expand Up @@ -137,8 +142,14 @@ - (void)layoutIndicatorLayerWithButton:(UIButton *)button
{
[CATransaction begin];
[CATransaction setDisableActions:YES];
CGFloat width = CGRectGetWidth(self.bounds);
CGFloat height = CGRectGetHeight(self.bounds);
[_bottomSeparator setFrame:(CGRect){
0.0, height - 1.0,
width, 1.0
}];
[_indicatorLayer setFrame:(CGRect){
CGRectGetMinX(button.frame), CGRectGetHeight(self.bounds) - 2.0,
CGRectGetMinX(button.frame), height - 2.0,
CGRectGetWidth(button.frame), 2.0
}];
[CATransaction commit];
Expand Down

0 comments on commit dba2461

Please sign in to comment.