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 customize the progress bar to rounded rect corner progress bar.
self.progressView.frame=CGRectMake(55, 490, 200, 15) self.progressView.layer.cornerRadius = 15.0 self.progressView.transform=CGAffineTransformMakeScale(1.0, 7.0)
You can round the corners of any SwiftUI view by using the cornerRadius() modifier. Simply add a value to the cornerRadius to control how rounded you want the view to be. Let us look at a simple example below. By adding a cornerRadius of 10 to our button we now get nice rounded corners on our button.
Select the LoadingView in the storyboard, and open the Attributes inspector. For the background Background, select System Gray 4 Color. Next, you'll add the progress bar.
Although you have set the corner radius, you also need to tell the view not to draw anything outside of the view's bounds by setting
self.progressView.clipsToBounds = true
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With