设置转换或工作后设置角半径IOS

问题描述:

我有UIProgressView,我想设置其角半径和转换,但角半径不能正常工作。设置转换或工作后设置角半径IOS

我在Xamarin.ios代码:

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:

enter image description here

不幸的是,我无法找到一个方法来解决它,因为CornerRadius不CGAffineTransform后适当工作。规模。

另一个诀窍是设置自定义TrackImage和ProgressImage,然后使CGAffineTransform.Scale。

它看起来像是由于转换不是身份。尝试使用位置/边界和cornerRadius来实现动画。

+0

这只是一个评论,低质量。 – Billa

+0

我遇到了同样的问题,并用上面的方法解决了它。 – numbbuaa