How to make rounded corner progress bar in swift?

前端 未结 5 1930
长情又很酷
长情又很酷 2021-01-03 21:24

Here I Have tried to make Rounded Rect corner progress bar but I have some problem to create it, here I have post my code what I am tried?

Any one Give idea to custo

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-03 22:04

    And if you want to have rounded edges for the inner bar too, you can also add this code:

    // Set the rounded edge for the outer bar
    self.layer.cornerRadius = 12
    self.clipsToBounds = true
    
    // Set the rounded edge for the inner bar        
    self.layer.sublayers![1].cornerRadius = 12
    self.subviews[1].clipsToBounds = true
    

提交回复
热议问题