Skip to content

Commit

Permalink
Merge pull request #3 from UberJason/master
Browse files Browse the repository at this point in the history
Support messages too long for the notification.
  • Loading branch information
azamsharp authored Mar 2, 2018
2 parents f7bdb10 + 79b88f8 commit 22a3a06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions demo/Helping/Helping/AZNotificationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion demo/Helping/Helping/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
5 changes: 4 additions & 1 deletion src/AZNotificationView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 22a3a06

Please sign in to comment.