我正在使用 Cosmos View 在这里显示一系列“星星”
我已经在我的单元格中设置了视图,我想将 SF Symbols 用于星形图像。但是,色调不起作用这里是我的代码,我不知道我是否遗漏了什么?
private let starView: CosmosView = {
let view = CosmosView()
view.translatesAutoresizingMaskIntoConstraints = false
view.isUserInteractionEnabled = false
view.settings.starSize = 16
view.settings.starMargin = 2
view.settings.disablePanGestures = true
view.settings.updateOnTouch = false
view.settings.filledImage = UIImage(systemName: "star.fill")?.withTintColor(.red, renderingMode: .alwaysOriginal)
view.settings.emptyImage = UIImage(systemName: "star")?.withTintColor(.red, renderingMode: .alwaysOriginal)
view.settings.fillMode = .half
return view
}()
有了这个,它仍然给我默认颜色。未.red
指定为色调颜色。