Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- + (UIImage *)nowPlayingButton {
- UILabel * addCustomLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 25)];
- addCustomLabel.text = NSLocalizedString(@"NOW_PLAYING_NEWLINE", @"Now playing text divided on two lines");
- addCustomLabel.textColor = [UIColor whiteColor];
- addCustomLabel.font = [UIFont boldSystemFontOfSize:10];
- addCustomLabel.numberOfLines = 2;
- addCustomLabel.backgroundColor = [UIColor clearColor];
- addCustomLabel.textAlignment = UITextAlignmentCenter;
- CGSize size = addCustomLabel.bounds.size;
- UIGraphicsBeginImageContext(size);
- CGContextRef context = UIGraphicsGetCurrentContext();
- [addCustomLabel.layer renderInContext: context];
- CGImageRef imageRef = CGBitmapContextCreateImage(context);
- UIImage *img = [UIImage imageWithCGImage: imageRef];
- CGImageRelease(imageRef);
- CGContextRelease(context);
- return img;
- }
Add Comment
Please, Sign In to add comment