Making UIProgressView Rounded corners

前端 未结 13 1669
旧巷少年郎
旧巷少年郎 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:44

    Yes ,one thing is missed...corner radius is set to progressview and it is reflecting as expected..

    But if you want your track image to be rounded you have to customise your progressview. You have to use image with rounded corner.

    [progressView setTrackImage:[UIImage imageNamed:@"roundedTrack.png"]];
    //roundedTrack.png must be of rounded corner
    

    This above code will help you to change image of trackView for your progressview.

    You may face the inappropriate stretching of image. You have to make your image resizable. May be the link below will be useful if issue arise https://www.natashatherobot.com/ios-stretchable-button-uiedgeinsetsmake/

提交回复
热议问题