【发布时间】:2016-12-16 21:34:27
【问题描述】:
为什么transform rotation 没有在情节提要中显示/预览?它在应用程序中运行良好。我的 @IBDesignable 类中还有其他可以正常工作的属性。
我怎样才能做到这一点?
@IBDesignable
class CustomUILabel: UILabel {
@IBInspectable var label_Rotation: Double = 0 {
didSet {
rotateLabel(label_Rotation)
}
}
func rotateLabel(labelRotation: Double) {
self.transform = CGAffineTransformMakeRotation(CGFloat(M_PI_2 + labelRotation))
}
}
【问题讨论】:
标签: ios swift uilabel transform ibdesignable