Ios 设置“变换”或“工作”后设置角半径
我有一个UIProgressView,我想设置它的角半径和变换,但是角半径没有按它应该的那样工作 我在Xamarin.ios中的代码:Ios 设置“变换”或“工作”后设置角半径,ios,transform,uiprogressview,cornerradius,Ios,Transform,Uiprogressview,Cornerradius,我有一个UIProgressView,我想设置它的角半径和变换,但是角半径没有按它应该的那样工作 我在Xamarin.ios中的代码: UIProgressView progressView = new UIProgressView(newFrame) { //Set background track color = gray TrackTintColor = CustomColor
UIProgressView progressView = new UIProgressView(newFrame)
{
//Set background track color = gray
TrackTintColor = CustomColors.CustomColors.GetColor(CustomColors.CustomColors.ColorGray),
//Set progress track color = blue
ProgressTintColor = CustomColors.CustomColors.GetColor(CustomColors.CustomColors.ColorBlue)
};
//Set Y scale
progressView.Transform = CGAffineTransform.Scale(progressView.Transform, 1, 20f);
progressView.Layer.CornerRadius = 15f;
progressView.Layer.MasksToBounds = true;
progressView.ClipsToBounds = true;
progressView:
不幸的是,我找不到修复它的方法,因为在CGAffineTransform.Scale之后,CornerRadius无法正常工作
另一个技巧是设置自定义TrackImage和ProgressImage,然后生成CGAffineTransform.Scale。它看起来像是由于转换而不是身份。尝试使用position/bounds和cornerRadius实现动画。这只是一个注释,质量很低。我遇到了同样的问题,并用上述方法解决了它。