如何在power view里面更改进度条颜色
答案:2 悬赏:0 手机版
解决时间 2021-03-10 17:10
- 提问者网友:浮克旳回音
- 2021-03-09 17:52
如何在power view里面更改进度条颜色
最佳答案
- 五星知识达人网友:猎心人
- 2021-03-09 18:17
GRect rtTemp = CGRectMake(nSpaceX, nSpaceY * 2, popBgView.frame.size.width - 22 * nSpaceX, 20);
if (isPad)
{
rtTemp.size.height = 30;
}
UIProgressView* progressView = [[UIProgressView alloc] initWithFrame:rtTemp];
progressView.backgroundColor = [UIColor clearColor];
[progressView setProgress:self.fPercent];
//更改进度条高度
progressView.transform = CGAffineTransformMakeScale(1.0f,3.0f);
UIImage* imgTemp = [UIImage imageNamed:@"progress_off.png"];
CGFloat width = imgTemp.size.width/2.0;
CGFloat height = imgTemp.size.height/2.0;
UIImage *imgTrack = [[UIImage imageNamed:@"progress_off.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(height, width, height, width)];
UIImage *imgProgress = [[UIImage imageNamed:@"progress_on.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(height, width, height, width)];
[progressView setProgressImage:imgProgress];
[progressView setTrackImage:imgTrack];
[popBgView addSubview:progressView];
[progressView release];
if (isPad)
{
rtTemp.size.height = 30;
}
UIProgressView* progressView = [[UIProgressView alloc] initWithFrame:rtTemp];
progressView.backgroundColor = [UIColor clearColor];
[progressView setProgress:self.fPercent];
//更改进度条高度
progressView.transform = CGAffineTransformMakeScale(1.0f,3.0f);
UIImage* imgTemp = [UIImage imageNamed:@"progress_off.png"];
CGFloat width = imgTemp.size.width/2.0;
CGFloat height = imgTemp.size.height/2.0;
UIImage *imgTrack = [[UIImage imageNamed:@"progress_off.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(height, width, height, width)];
UIImage *imgProgress = [[UIImage imageNamed:@"progress_on.png"]resizableImageWithCapInsets:UIEdgeInsetsMake(height, width, height, width)];
[progressView setProgressImage:imgProgress];
[progressView setTrackImage:imgTrack];
[popBgView addSubview:progressView];
[progressView release];
全部回答
- 1楼网友:纵马山川剑自提
- 2021-03-09 19:26
同问。。。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯