From 4a059f68b68c7145e6937d9aa384a9781a5227cb Mon Sep 17 00:00:00 2001 From: onevcat Date: Fri, 9 Oct 2015 20:31:40 +0900 Subject: [PATCH] Fix for indicator center --- Kingfisher/Info.plist | 2 +- Kingfisher/UIImageView+Kingfisher.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Kingfisher/Info.plist b/Kingfisher/Info.plist index d6c28bc6f..83d887d50 100644 --- a/Kingfisher/Info.plist +++ b/Kingfisher/Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 264 + 265 NSPrincipalClass diff --git a/Kingfisher/UIImageView+Kingfisher.swift b/Kingfisher/UIImageView+Kingfisher.swift index 42e946ce1..a6fe50b3a 100644 --- a/Kingfisher/UIImageView+Kingfisher.swift +++ b/Kingfisher/UIImageView+Kingfisher.swift @@ -281,7 +281,8 @@ public extension UIImageView { } else { if newValue { let indicator = UIActivityIndicatorView(activityIndicatorStyle:.Gray) - indicator.center = center + indicator.center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)) + indicator.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin, .FlexibleBottomMargin, .FlexibleTopMargin] indicator.hidden = true indicator.hidesWhenStopped = true