我尝试在我的项目中使用 KDCircularProgress in progressView 类,它固有的 UIView 类
init(frame: CGRect) {
    progress = KDCircularProgress(frame: frame)
    letter = "A"
    super.init(frame: frame)
    setupCircularProgress(frame: frame)
    UILabel()
        .add(to: self)
        .layout { (make) in
            make.center.equalToSuperview()
    }.config { (view) in
        view.text = letter
    }   
}
和 setupCircularProgress 函数:
func setupCircularProgress(frame:CGRect) {
    progress.clockwise = true
    progress.set(colors: randomColor(hue: .random, luminosity: .light))
    progress.glowMode = .forward
    progress.glowAmount = 0
    progress.center = self.center
    progress.trackColor = UIColor.white
    self.addSubview(progress)
    progress.animate(fromAngle: 0, toAngle: 360, duration: 5, completion: { completed in
        if completed {
            print("animation stopped, completed")
            self.removeFromSuperview()
        } else {
            print("animation stopped, was interrupted")
        }
    })
}
在视图控制器中
LetterView(frame: CGRect(x: 50, y: 50, width: 50, height: 50)).add(to: self.playView!)
但它显示像这样 显示的视图
我不知道为什么 KDCircularProgress 在框架之外,只有 textLabel 在正确的位置。并且没有逻辑将根据分配的框架显示 KDCircularProgress 视图。
如果有人处理过这种情况和问题,请告诉我如何解决。