Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
Fixes a bug that prevents tab bar to set its background color
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilter Cengiz committed Oct 28, 2013
1 parent a105900 commit bddd4ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ICViewPager/Controller/HostViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)selectTabWithNumberFive {

#pragma mark - ViewPagerDataSource
- (NSUInteger)numberOfTabsForViewPager:(ViewPagerController *)viewPager {
return 10;
return 2;
}
- (UIView *)viewPager:(ViewPagerController *)viewPager viewForTabAtIndex:(NSUInteger)index {

Expand Down Expand Up @@ -102,6 +102,8 @@ - (UIColor *)viewPager:(ViewPagerController *)viewPager colorForComponent:(ViewP
switch (component) {
case ViewPagerIndicator:
return [[UIColor redColor] colorWithAlphaComponent:0.64];
case ViewPagerTabsView:
return [[UIColor greenColor] colorWithAlphaComponent:0.64];
default:
return color;
}
Expand Down
2 changes: 1 addition & 1 deletion ICViewPager/ICViewPager/ViewPagerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ - (UIColor *)indicatorColor {
}
- (UIColor *)tabsViewBackgroundColor {

if (_tabsViewBackgroundColor) {
if (!_tabsViewBackgroundColor) {
UIColor *color = [UIColor colorWithRed:234.0/255.0 green:234.0/255.0 blue:234.0/255.0 alpha:0.75];
if ([self.delegate respondsToSelector:@selector(viewPager:colorForComponent:withDefault:)]) {
color = [self.delegate viewPager:self colorForComponent:ViewPagerTabsView withDefault:color];
Expand Down

0 comments on commit bddd4ce

Please sign in to comment.