Skip to content

Commit

Permalink
Merge pull request #68 from yukitoto/master
Browse files Browse the repository at this point in the history
Add highlighted image option for extra buttons of both side
  • Loading branch information
serejahh authored Jan 16, 2017
2 parents 38698fe + 6ae3363 commit 6892ef3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FoldingTabBar/Model/TabBarItem/YALTabBarItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong, nullable) UIImage *itemImage;
@property (nonatomic, strong, nullable) UIImage *leftImage;
@property (nonatomic, strong, nullable) UIImage *rightImage;
@property (nonatomic, strong, nullable) UIImage *leftHighlightedImage;
@property (nonatomic, strong, nullable) UIImage *rightHighlightedImage;

- (instancetype)initWithItemImage:(UIImage * _Nullable)itemImage
leftItemImage:(UIImage * _Nullable)leftItemImage
Expand Down
7 changes: 7 additions & 0 deletions FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,19 @@ - (void)configureExtraTabBarItemWithModel:(YALTabBarItem *)item {
if (item.leftImage) {
self.extraLeftButton.hidden = NO;
[self.extraLeftButton setImage:item.leftImage forState:UIControlStateNormal];
if (item.leftHighlightedImage) {
[self.extraLeftButton setImage:item.leftHighlightedImage forState:UIControlStateHighlighted];
}

} else {
self.extraLeftButton.hidden = YES;
}
if (item.rightImage) {
self.extraRightButton.hidden = NO;
[self.extraRightButton setImage:item.rightImage forState:UIControlStateNormal];
if (item.rightHighlightedImage) {
[self.extraRightButton setImage:item.rightHighlightedImage forState:UIControlStateHighlighted];
}
} else {
self.extraRightButton.hidden = YES;
}
Expand Down

0 comments on commit 6892ef3

Please sign in to comment.