diff --git a/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h b/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h index 2a808d9..a35c658 100644 --- a/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h +++ b/FoldingTabBar/Model/TabBarItem/YALTabBarItem.h @@ -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 diff --git a/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m b/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m index 187bb48..b9c2d60 100644 --- a/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m +++ b/FoldingTabBar/View/FoldingTabBar/YALFoldingTabBar.m @@ -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; }