From a6f81e829bf17fd3157728ef2d01d193f28da4c5 Mon Sep 17 00:00:00 2001 From: Robert Dimitrov Date: Mon, 22 Dec 2014 15:16:22 +0200 Subject: [PATCH] Fix an issue where tabBarItem's title frame was calculated only based on the font size, ignoring kerning. --- RDVTabBarController.podspec | 4 ++-- RDVTabBarController/RDVTabBarItem.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RDVTabBarController.podspec b/RDVTabBarController.podspec index 66125a1..1571320 100644 --- a/RDVTabBarController.podspec +++ b/RDVTabBarController.podspec @@ -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 diff --git a/RDVTabBarController/RDVTabBarItem.m b/RDVTabBarController/RDVTabBarItem.m index 52835e0..b3fdcf4 100755 --- a/RDVTabBarController/RDVTabBarItem.m +++ b/RDVTabBarController/RDVTabBarItem.m @@ -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); @@ -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);