Skip to content

Commit

Permalink
v1.17.19 fix ios 11 UITabBar UITabBarItem positioning issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenYilong committed Oct 26, 2018
1 parent 65d6deb commit 876b560
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CYLTabBarController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CYLTabBarController"
s.version = "1.17.18"
s.version = "1.17.19"
s.summary = "Highly customizable tabBar and tabBarController for iOS"
s.description = "CYLTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController."
s.homepage = "https://github.com/ChenYilong/CYLTabBarController"
Expand Down
8 changes: 8 additions & 0 deletions CYLTabBarController/CYLTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -458,4 +458,12 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
return nil;
}

// In iOS 11, UITabBarItem's have the title to the right of the icon in horizontally regular environments
// (i.e. the iPad). In order to keep the title below the icon, it was necessary to subclass UITabBar and override
// traitCollection to make it horizontally compact.

- (UITraitCollection *)traitCollection {
return [UITraitCollection traitCollectionWithHorizontalSizeClass:UIUserInterfaceSizeClassCompact];
}

@end

0 comments on commit 876b560

Please sign in to comment.