新奇的需求,記錄一下
使用了SD框架,別的方法要用一堆廢物代碼
#import "UIImage+GIF.h"
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"旋轉跳躍" ofType:@"gif"];
NSData *imageData = [NSData dataWithContentsOfFile:imagePath];
UIImage *image = [UIImage sd_imageWithGIFData:imageData];
[loveSongBtn setImage:image forState:UIControlStateNormal];
UILabel添加陰影
NSShadow *shadow = [[NSShadow alloc]init];
shadow.shadowBlurRadius = 2;
shadow.shadowOffset = CGSizeMake(0, 0);
shadow.shadowColor = [UIColor blackColor];
NSAttributedString *art = [[NSAttributedString alloc]initWithString:@"qweqweqwe" attributes:@{NSShadowAttributeName:shadow}];
_label.attributedText = art;