diff --git a/demo/Helping/Helping/AZNotificationView.m b/demo/Helping/Helping/AZNotificationView.m index d687cc0..6b972ed 100644 --- a/demo/Helping/Helping/AZNotificationView.m +++ b/demo/Helping/Helping/AZNotificationView.m @@ -99,11 +99,13 @@ -(void) setup [self setupNotificationType]; // create the labels - UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, screenBounds.size.width, NOTIFICATION_VIEW_HEIGHT)]; + UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, screenBounds.size.width-20, NOTIFICATION_VIEW_HEIGHT)]; titleLabel.text = _title; titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17]; titleLabel.textColor = [UIColor whiteColor]; - + titleLabel.numberOfLines = 1; + titleLabel.minimumScaleFactor = 0.75; + titleLabel.adjustsFontSizeToFitWidth = YES; [self addSubview:titleLabel]; } diff --git a/demo/Helping/Helping/ViewController.m b/demo/Helping/Helping/ViewController.m index ee2ecef..cadecb6 100644 --- a/demo/Helping/Helping/ViewController.m +++ b/demo/Helping/Helping/ViewController.m @@ -35,7 +35,7 @@ -(IBAction) show:(id)sender } else if(tag == 2) { - [AZNotification showNotificationWithTitle:@"Oh BTW! Your hair is on fire!" controller:self notificationType:AZNotificationTypeWarning]; + [AZNotification showNotificationWithTitle:@"Oh BTW! Your hair is on fire! This is a really really really long message!" controller:self notificationType:AZNotificationTypeWarning]; } else { diff --git a/src/AZNotificationView.m b/src/AZNotificationView.m index d687cc0..1083f5c 100644 --- a/src/AZNotificationView.m +++ b/src/AZNotificationView.m @@ -99,10 +99,13 @@ -(void) setup [self setupNotificationType]; // create the labels - UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, screenBounds.size.width, NOTIFICATION_VIEW_HEIGHT)]; + UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, screenBounds.size.width-20, NOTIFICATION_VIEW_HEIGHT)]; titleLabel.text = _title; titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17]; titleLabel.textColor = [UIColor whiteColor]; + titleLabel.numberOfLines = 1; + titleLabel.minimumScaleFactor = 0.75; + titleLabel.adjustsFontSizeToFitWidth = YES; [self addSubview:titleLabel]; }