一个高仿QQ讨论组头像的实现
手动添加Classes文件中的类。
pod 'QQHeader'
github "itlijunjie/QQHeader"
每个头像可以分为一个个的小头像:
JJCustomLayer
就是每个小头像:主要负责头像的裁剪
JJHeaders
就是最终的头像:主要负责计算出每个小头像的center
JJHeadersConfig
主要负责头像参数的配置,目前只配置了裁剪角度的大小
UIView *view = [JJHeaders createHeaderView:viewWH
images:@[[UIImage imageNamed:@"0"],
[UIImage imageNamed:@"1"],
[UIImage imageNamed:@"2"],
[UIImage imageNamed:@"3"],
[UIImage imageNamed:@"4"]]];
let view = JJHeaders.createHeaderView(viewWH, images: [
UIImage(named: "0")!,
UIImage(named: "1")!,
UIImage(named: "2")!,
UIImage(named: "3")!,
UIImage(named: "4")!
])
QQHeader is under WTFPL. You can do what the fuck you want with QQHeader. See LICENSE file for more info.