gpt4 book ai didi

ios - Objective-C:以编程方式查看进度

转载 作者:行者123 更新时间:2023-11-29 00:46:55 27 4
gpt4 key购买 nike

如何在我的 Xcode 项目中以编程方式创建高度为 50 和圆角的 progressView

如果我使用这段代码

CGAffineTransform transform = CGAffineTransformMakeScale(1.0f, 3.0f);  
progressView.transform = transform;

圆角消失

最佳答案

我尝试获取带有圆角的进度 View 。我明白了。

首先你需要添加和导入

#import <QuartzCore/QuartzCore.h>

然后

UIProgressView *progressView;
progressView = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
progressView.progressTintColor = [UIColor colorWithRed:187.0/255 green:160.0/255 blue:209.0/255 alpha:1.0];
[[progressView layer]setFrame:CGRectMake(20, 50, 200, 200)];
[[progressView layer]setBorderColor:[UIColor redColor].CGColor];
progressView.trackTintColor = [UIColor clearColor];
[progressView setProgress:(float)(50/100) animated:YES]; ///15

[[progressView layer]setCornerRadius:progressView.frame.size.width / 2];
[[progressView layer]setBorderWidth:3];
[[progressView layer]setMasksToBounds:TRUE];
progressView.clipsToBounds = YES;

[self.view addSubview:progressView];

还有

KAProgressLabel

Circular Progress View

Progress View Using Bezir Path

关于ios - Objective-C:以编程方式查看进度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38525538/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com