diff --git a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m index 2f68e88..cddb35a 100644 --- a/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m +++ b/XLPagerTabStrip/XL/Controllers/XLButtonBarPagerTabStripViewController.m @@ -228,6 +228,16 @@ [buttonBarCell.label setText:[childController titleForPagerTabStripViewController:self]]; + if ([childController respondsToSelector:@selector(imageForPagerTabStripViewController:)]) { + UIImage *image = [childController imageForPagerTabStripViewController:self]; + buttonBarCell.imageView.image = image; + } + + if ([childController respondsToSelector:@selector(highlightedImageForPagerTabStripViewController:)]) { + UIImage *image = [childController highlightedImageForPagerTabStripViewController:self]; + buttonBarCell.imageView.highlightedImage = image; + } + if (self.isProgressiveIndicator) { if (self.changeCurrentIndexProgressiveBlock) { self.changeCurrentIndexProgressiveBlock(self.currentIndex == indexPath.item ? nil : cell , self.currentIndex == indexPath.item ? cell : nil, 1, YES, NO); diff --git a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h index 16af595..c573c58 100644 --- a/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h +++ b/XLPagerTabStrip/XL/Controllers/XLPagerTabStripViewController.h @@ -40,6 +40,7 @@ @optional - (UIImage *)imageForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController; +- (UIImage *)highlightedImageForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController; - (UIColor *)colorForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController; @end