简体   繁体   中英

ios squaring edges in UIProgressView

I'm writing a UI for iPad and part of that UI needs progress bars for certain parts. However, I'm finding that configuring the UIProgressView is proving difficult. One of the requirements is that the endpoints of the progress view be square, however, I am unable to configure this via the layer's corner radius property:

    fProgressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
    fProgressView.layer.borderColor = [UIColor whiteColor].CGColor;
    fProgressView.progress = 0.5f;
    fProgressView.progressImage = nil;
    fProgressView.trackImage = nil;
    fProgressView.trackTintColor = self.fPatientListPanelColor;
    fProgressView.progressTintColor = [UIColor whiteColor];
    [fProgressView.layer setCornerRadius:1.0f];
    [self.view addSubView:fProgressView]

I find I am also unable to control the height of it. Any thoughts on how to overcome these issues?

显然没有办法做到这一点,所以我最终推出了自己的版本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM