Ios tableView滚动,然后progressView角半径自动更改

Ios tableView滚动,然后progressView角半径自动更改,ios,swift,tableview,progress-bar,scrollview,Ios,Swift,Tableview,Progress Bar,Scrollview,我在表格视图中添加进度视图。我滚动uitableView,然后轨迹角半径不显示如何设置其角半径。 甚至我还添加了层角半径 progressBar.layer.sublayers![1].cornerRadius = 8 progressBar.subviews[1].clipsToBounds = true 请使用以下swift 5.0扩展设置角半径 extension UIView{ func setCorner(withRadius:Int, borderWidth:Int =

我在表格视图中添加进度视图。我滚动uitableView,然后轨迹角半径不显示如何设置其角半径。 甚至我还添加了层角半径

 progressBar.layer.sublayers![1].cornerRadius = 8
 progressBar.subviews[1].clipsToBounds = true

请使用以下swift 5.0扩展设置角半径

extension UIView{
    func setCorner(withRadius:Int, borderWidth:Int = 0, color: UIColor = .clear){
        self.layer.cornerRadius = radius
        self.layer.borderColor = color
        self.layer.borderWidth = borderWidth
        self.clipsToBounds = true
    }
}
并将其用作

progressBar.setCorner(withRadius: 8)//what ever radius you want to set.