【发布时间】:2020-01-17 07:10:26
【问题描述】:
我正在尝试使用新的conic gradient type。我已经将部署目标设置为 12.0 并添加了 QuartzCore 框架,并且我将渐变的类型设置为 .conic:
let gradient = CAGradientLayer()
gradient.type = CAGradientLayerType.conic
我什至可以点击进入文档:
extension CAGradientLayerType {
...
/* Conic gradient. The gradient is centered at 'startPoint' and its 0-degrees
* direction is defined by a vector spanned between 'startPoint' and
* 'endPoint'. When 'startPoint' and 'endPoint' overlap the results are
* undefined. The gradient's angle increases in the direction of rotation of
* positive x-axis towards positive y-axis. */
@available(iOS 12.0, *)
public static let conic: CAGradientLayerType
}
但我仍然收到此构建错误:
Type 'CAGradientLayerType' (aka 'NSString') has no member 'conic'
【问题讨论】: