本文介绍了iOS上是否可以有从右到左的进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我已尝试发送 [UIProgressView setProgress] 负值,但无效。 解决方案您可以尝试设置 UIProgressView 的c> transform 属性转换为旋转的新 CGAffineTransform 视图180度并垂直翻转(保留shininess)(参见 CGAffineTransformMake()和 CGAffineTransformRotate() UIProgressView * pv = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; pv.frame = CGRectMake(10,100,300,11); CGAffineTransform transform = CGAffineTransformMake(1,0,0,-1,0,pv.frame.size.height); //垂直翻转视图 transform = CGAffineTransformRotate(transform,M_PI); //旋转角度以弧度表示 pv.transform = transform; pv.progress = 0.5; I've tried sending [UIProgressView setProgress] negative values, and that doesn't work.Is there some other way to get a progress bar that fills from the right-hand end? 解决方案 You could try setting the transform property of your UIProgressView to a new CGAffineTransform that rotates the view by 180 degrees and flips it vertically (to preserve the "shininess") (see CGAffineTransformMake() and CGAffineTransformRotate()).Something along the lines of:UIProgressView *pv = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];pv.frame = CGRectMake(10, 100, 300, 11);CGAffineTransform transform = CGAffineTransformMake(1, 0, 0, -1, 0, pv.frame.size.height); // Flip view verticallytransform = CGAffineTransformRotate(transform, M_PI); //Rotation angle is in radianspv.transform = transform;pv.progress = 0.5; 这篇关于iOS上是否可以有从右到左的进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-20 20:28