Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 设置“变换”或“工作”后设置角半径_Ios_Transform_Uiprogressview_Cornerradius - Fatal编程技术网

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,我想设置它的角半径和变换,但是角半径没有按它应该的那样工作

我在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:


不幸的是,我找不到修复它的方法,因为在CGAffineTransform.Scale之后,CornerRadius无法正常工作


另一个技巧是设置自定义TrackImage和ProgressImage,然后生成CGAffineTransform.Scale。

它看起来像是由于转换而不是身份。尝试使用position/bounds和cornerRadius实现动画。

这只是一个注释,质量很低。我遇到了同样的问题,并用上述方法解决了它。