我试过发送[UIProgressView setProgress]负值,但这不起作用.
是否有其他方法可以从右侧获得进度条?
解决方法
您可以尝试将UIProgressView的
transform
属性设置为新的CGAffineTransform,将视图旋转180度并垂直翻转(以保持“光泽”)(请参阅CGAffineTransformMake()和CGAffineTransformRotate()).
有点像:
UIProgressView *pv = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; pv.frame = CGRectMake(10,100,300,11); CGAffineTransform transform = CGAffineTransformMake(1,-1,pv.frame.size.height); // Flip view vertically transform = CGAffineTransformRotate(transform,M_PI); //Rotation angle is in radians pv.transform = transform; pv.progress = 0.5;