Making UIProgressView Rounded corners

前端 未结 13 1685
旧巷少年郎
旧巷少年郎 2021-02-07 13:59

I have created a UIProgressView with following properties

progressView.progressTintColor = UIColor.appChallengeColorWithAlpha(1.0)
progressView.trac         


        
13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 14:40

    With swift 4.0 I'm doing in this way:

    let progressViewHeight: CGFloat = 4.0
    
    // Set progress view height
    let transformScale = CGAffineTransform(scaleX: 1.0, y: progressViewHeight)
    self.progressView.transform = transformScale
    
    // Set progress round corners
    self.progressView.layer.cornerRadius = progressViewHeight
    self.progressView.clipsToBounds = true
    

提交回复
热议问题