Skip to content

Commit a8ff2e9

Browse files
committed
Modify TabBar image color
Former-commit-id: d6f2a55
1 parent 934fa1a commit a8ff2e9

File tree

3 files changed

+63
-11
lines changed

3 files changed

+63
-11
lines changed

MVVMReactiveCocoa/MRCAppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ - (void)configureAppearance {
117117

118118
[UISegmentedControl appearance].tintColor = [UIColor whiteColor];
119119

120-
[UITabBar appearance].tintColor = HexRGB(colorI2);
120+
[UITabBar appearance].tintColor = HexRGB(colorI3);
121121
}
122122

123123
- (void)configureKeyboardManager {

MVVMReactiveCocoa/View/MRCHomepageViewController.m

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,87 @@ - (void)viewDidLoad {
3535
UINavigationController *newsNavigationController = ({
3636
MRCNewsViewController *newsViewController = [[MRCNewsViewController alloc] initWithViewModel:self.viewModel.newsViewModel];
3737

38-
UIImage *newsImage = [UIImage octicon_imageWithIdentifier:@"Rss" size:CGSizeMake(25, 25)];
39-
newsViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"News" image:newsImage tag:1];
38+
UIImage *newsImage = [UIImage octicon_imageWithIcon:@"Rss"
39+
backgroundColor:[UIColor clearColor]
40+
iconColor:[UIColor lightGrayColor]
41+
iconScale:1
42+
andSize:CGSizeMake(25, 25)];
43+
UIImage *newsHLImage = [UIImage octicon_imageWithIcon:@"Rss"
44+
backgroundColor:[UIColor clearColor]
45+
iconColor:HexRGB(colorI3)
46+
iconScale:1
47+
andSize:CGSizeMake(25, 25)];
48+
49+
newsImage = [newsImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
50+
newsHLImage = [newsHLImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
51+
52+
newsViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"News" image:newsImage selectedImage:newsHLImage];
4053

4154
[[MRCNavigationController alloc] initWithRootViewController:newsViewController];
4255
});
4356

4457
UINavigationController *reposNavigationController = ({
4558
MRCReposViewController *reposViewController = [[MRCReposViewController alloc] initWithViewModel:self.viewModel.reposViewModel];
46-
47-
UIImage *reposImage = [UIImage octicon_imageWithIdentifier:@"Repo" size:CGSizeMake(25, 25)];
48-
reposViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Repositories" image:reposImage tag:2];
59+
60+
UIImage *reposImage = [UIImage octicon_imageWithIcon:@"Repo"
61+
backgroundColor:[UIColor clearColor]
62+
iconColor:[UIColor lightGrayColor]
63+
iconScale:1
64+
andSize:CGSizeMake(25, 25)];
65+
UIImage *reposHLImage = [UIImage octicon_imageWithIcon:@"Repo"
66+
backgroundColor:[UIColor clearColor]
67+
iconColor:HexRGB(colorI3)
68+
iconScale:1
69+
andSize:CGSizeMake(25, 25)];
70+
71+
reposImage = [reposImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
72+
reposHLImage = [reposHLImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
73+
74+
reposViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Repositories" image:reposImage selectedImage:reposHLImage];
4975

5076
[[MRCNavigationController alloc] initWithRootViewController:reposViewController];
5177
});
5278

5379
UINavigationController *searchNavigationController = ({
5480
MRCSearchViewController *searchViewController = [[MRCSearchViewController alloc] initWithViewModel:self.viewModel.searchViewModel];
5581

56-
UIImage *searchImage = [UIImage octicon_imageWithIdentifier:@"Search" size:CGSizeMake(25, 25)];
57-
searchViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Discover" image:searchImage tag:3];
82+
UIImage *searchImage = [UIImage octicon_imageWithIcon:@"Search"
83+
backgroundColor:[UIColor clearColor]
84+
iconColor:[UIColor lightGrayColor]
85+
iconScale:1
86+
andSize:CGSizeMake(25, 25)];
87+
UIImage *searchHLImage = [UIImage octicon_imageWithIcon:@"Search"
88+
backgroundColor:[UIColor clearColor]
89+
iconColor:HexRGB(colorI3)
90+
iconScale:1
91+
andSize:CGSizeMake(25, 25)];
92+
93+
searchImage = [searchImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
94+
searchHLImage = [searchHLImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
95+
96+
searchViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Discover" image:searchImage selectedImage:searchHLImage];
5897

5998
[[MRCNavigationController alloc] initWithRootViewController:searchViewController];
6099
});
61100

62101
UINavigationController *profileNavigationController = ({
63102
MRCProfileViewController *profileViewController = [[MRCProfileViewController alloc] initWithViewModel:self.viewModel.profileViewModel];
64103

65-
UIImage *profileImage = [UIImage octicon_imageWithIdentifier:@"Person" size:CGSizeMake(25, 25)];
66-
profileViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Profile" image:profileImage tag:4];
104+
UIImage *profileImage = [UIImage octicon_imageWithIcon:@"Person"
105+
backgroundColor:[UIColor clearColor]
106+
iconColor:[UIColor lightGrayColor]
107+
iconScale:1
108+
andSize:CGSizeMake(25, 25)];
109+
UIImage *profileHLImage = [UIImage octicon_imageWithIcon:@"Person"
110+
backgroundColor:[UIColor clearColor]
111+
iconColor:HexRGB(colorI3)
112+
iconScale:1
113+
andSize:CGSizeMake(25, 25)];
114+
115+
profileImage = [profileImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
116+
profileHLImage = [profileHLImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
117+
118+
profileViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Profile" image:profileImage selectedImage:profileHLImage];
67119

68120
[[MRCNavigationController alloc] initWithRootViewController:profileViewController];
69121
});

Pods/Pods.xcodeproj/xcshareddata/xcschemes/WXTabBarController.xcscheme

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)