雇用我们
CombinedView
一个简单的库,可以将 iOS 应用程序中的不同图像组合在一个 UIView 中,如 Apple Music 专辑封面。您可以使用任意数量的图像。
用法
在您的 .storyboard 或 .xib 中添加一个 UIView
实例,设置类为 CombinedView
,连接一个 IBOutlet
,并使用一个图像数组调用 combine(images: [UIImage?] 函数。
import CombinedView
class ViewController: UIViewController {
@IBOutlet weak var combinedView: CombinedView!
override func viewDidLoad() {
super.viewDidLoad()
combinedView.combine(images: [UIImage(named: "panda"), UIImage(named: "racoon"), UIImage(named: "tiger"), UIImage(named: "animal")])
}
}
如有需要,配置 CombinedView
override func viewDidLoad() {
super.viewDidLoad()
combinedView.combine(images: [UIImage(named: "panda"), UIImage(named: "racoon"), UIImage(named: "tiger"), UIImage(named: "animal")])
combinedView.cornerRadius = 4
combinedView.startAngle = 0
combinedView.contentMode = .scaleAspectFill
}
自定义
参数 | 描述 |
---|---|
cornerRadius | 设置当前视图的圆角半径 |
startAngle | 设置图像旋转的起始角度 |
兼容性
- 兼容 iOS 11 及以上
更改日志
版本:1.0
- 初始构建
贡献者
- 欢迎各种贡献
- 如果你想要某个特性并且能编写代码,请随意复制并添加更改,然后创建拉取请求。