From 95d656295598ce1e5f590d9a1ace6b30944ec90c Mon Sep 17 00:00:00 2001 From: Demetri Miller Date: Mon, 22 Jun 2015 15:44:05 -0500 Subject: [PATCH] titleView's label now centers correctly --- IBActionSheetSample/IBActionSheetSample/IBActionSheet.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IBActionSheetSample/IBActionSheetSample/IBActionSheet.m b/IBActionSheetSample/IBActionSheetSample/IBActionSheet.m index 5bf6c84..f4c5cd8 100755 --- a/IBActionSheetSample/IBActionSheetSample/IBActionSheet.m +++ b/IBActionSheetSample/IBActionSheetSample/IBActionSheet.m @@ -1108,14 +1108,14 @@ - (id)initWithTitle:(NSString *)title font:(UIFont *)font { - (void)resizeForPortraitOrientation { self.frame = CGRectMake(0, 0, CGRectGetWidth(adjustedScreenBounds()) - 16, CGRectGetHeight(self.frame)); - self.titleLabel.frame = CGRectMake(0, 0, CGRectGetWidth(adjustedScreenBounds()) - 24, 44); + self.titleLabel.frame = self.bounds; [self setMaskTo:self byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight]; } - (void)resizeForLandscapeOrientation { self.frame = CGRectMake(0, 0, CGRectGetWidth(adjustedScreenBounds()) - 16, CGRectGetHeight(self.frame)); - self.titleLabel.frame = CGRectMake(0, 0, CGRectGetWidth(adjustedScreenBounds()) - 44, 44); + self.titleLabel.frame = self.bounds; [self setMaskTo:self byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight]; }