Skip to content

Commit

Permalink
Fix an issue where tabBarItem's title frame was calculated only based…
Browse files Browse the repository at this point in the history
… on the font size, ignoring kerning.
  • Loading branch information
robbdimitrov committed Dec 22, 2014
1 parent 7e538f2 commit a6f81e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions RDVTabBarController.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = "RDVTabBarController"
s.version = "1.1.8"
s.version = "1.1.9"
s.summary = "Highly customizable tabBar and tabBarController for iOS"
s.description = "RDVTabBarController is iPad and iPhone compatible. Supports landscape and portrait orientations and can be used inside UINavigationController."
s.homepage = "https://github.com/robbdimitrov/RDVTabBarController"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Robert Dimitrov" => "robert_dimitrov@me.com" }
s.platform = :ios, '5.0'
s.source = { :git => "https://github.com/robbdimitrov/RDVTabBarController.git", :tag => "v1.1.8" }
s.source = { :git => "https://github.com/robbdimitrov/RDVTabBarController.git", :tag => "v1.1.9" }
s.source_files = 'RDVTabBarController', 'RDVTabBarController/**/*.{h,m}'
s.framework = 'UIKit', 'CoreGraphics', 'Foundation'
s.requires_arc = true
Expand Down
4 changes: 2 additions & 2 deletions RDVTabBarController/RDVTabBarItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ - (void)drawRect:(CGRect)rect {
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
titleSize = [_title boundingRectWithSize:CGSizeMake(frameSize.width, 20)
options:NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName: titleAttributes[NSFontAttributeName]}
attributes:titleAttributes
context:nil].size;

imageStartingY = roundf((frameSize.height - imageSize.height - titleSize.height) / 2);
Expand All @@ -151,7 +151,7 @@ - (void)drawRect:(CGRect)rect {
} else {
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
titleSize = [_title sizeWithFont:titleAttributes[UITextAttributeFont]
constrainedToSize:CGSizeMake(frameSize.width, 20)];
constrainedToSize:CGSizeMake(frameSize.width, 20)];
UIOffset titleShadowOffset = [titleAttributes[UITextAttributeTextShadowOffset] UIOffsetValue];
imageStartingY = roundf((frameSize.height - imageSize.height - titleSize.height) / 2);

Expand Down

0 comments on commit a6f81e8

Please sign in to comment.