From e580e14706e35018e235fef1b00c263e33873c39 Mon Sep 17 00:00:00 2001 From: DaidoujiChen Date: Wed, 20 Jun 2018 17:26:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=AB=20tabbar=20=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E7=B3=BB=E7=B5=B1=E7=9A=84=20icon=20OwO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++ Dai-Hentai/Base.lproj/Main.storyboard | 33 ++++++++----------- Dai-Hentai/Info.plist | 2 +- .../TabBarController/TabBarController.m | 14 ++++++++ 4 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 Dai-Hentai.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Dai-Hentai.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Dai-Hentai.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Dai-Hentai.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Dai-Hentai/Base.lproj/Main.storyboard b/Dai-Hentai/Base.lproj/Main.storyboard index 944abe67..836447a1 100644 --- a/Dai-Hentai/Base.lproj/Main.storyboard +++ b/Dai-Hentai/Base.lproj/Main.storyboard @@ -1,21 +1,16 @@ - + - + - - - HelveticaNeue-Bold - - @@ -49,7 +44,7 @@ - + @@ -272,11 +267,11 @@ - + - + @@ -289,11 +284,11 @@ - + - + @@ -476,11 +471,11 @@ - + - + @@ -493,11 +488,11 @@ - + - + @@ -881,7 +876,7 @@ - + @@ -936,7 +931,7 @@ - + @@ -1120,6 +1115,6 @@ - + diff --git a/Dai-Hentai/Info.plist b/Dai-Hentai/Info.plist index 16209828..a3432fba 100644 --- a/Dai-Hentai/Info.plist +++ b/Dai-Hentai/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString 3.2 CFBundleVersion - 20180326 + 20180620 Fabric APIKey diff --git a/Dai-Hentai/ViewControllers/TabBarController/TabBarController.m b/Dai-Hentai/ViewControllers/TabBarController/TabBarController.m index f4f63b7c..ed668f18 100644 --- a/Dai-Hentai/ViewControllers/TabBarController/TabBarController.m +++ b/Dai-Hentai/ViewControllers/TabBarController/TabBarController.m @@ -41,6 +41,20 @@ - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewCon - (void)viewDidLoad { [super viewDidLoad]; self.delegate = self; + + __block NSMutableArray *titles = [NSMutableArray arrayWithObjects:@"列表", @"歷史", @"下載", @"設定", nil]; + [self.tabBar.subviews enumerateObjectsUsingBlock: ^(UIView *v, NSUInteger tabBarIndex, BOOL *tabBarStop) { + if ([v isKindOfClass:NSClassFromString(@"UITabBarButton")] && v.subviews.count == 2) { + [v.subviews enumerateObjectsUsingBlock: ^(UIView *buttonSubView, NSUInteger buttonIndex, BOOL *buttonStop) { + if ([buttonSubView isKindOfClass:NSClassFromString(@"UITabBarButtonLabel")]) { + [buttonSubView performSelector:@selector(setText:) withObject:titles.firstObject]; + [buttonSubView sizeToFit]; + [titles removeObjectAtIndex:0]; + *buttonStop = YES; + } + }]; + } + }]; } @end