2017-06-15 91 views
1

我有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

回答

1

不幸的是,我無法找到一個方法來解決它,因爲CornerRadius不CGAffineTransform後適當工作。規模。

另一個訣竅是設置自定義TrackImage和ProgressImage,然後使CGAffineTransform.Scale。

0

它看起來像是由於轉換不是身份。嘗試使用位置/邊界和cornerRadius來實現動畫。

+0

這只是一個評論,低質量。 – Billa

+0

我遇到了同樣的問題,並用上面的方法解決了它。 – numbbuaa

相關問題