我正在使用Xamarin.IOS,在两个按钮的UIScrollView中也有UIprogressView。UIProgressView在设备旋转时消失或不缩放
我对代码ViewWillLayoutSubviews方法设置UIprogressView框架:
CGRect newFrame;
newFrame.Width = MyScrollView.Frame.Width/2;
newFrame.Location = new CGPoint(0, NextButton.Frame.Y);
MyProgressView.Frame = newFrame;
MyProgressView.Transform = CGAffineTransform.MakeScale(1, 20f);
MyProgressView.TrackTintColor = CustomColors.CustomColors.GetColor(CustomColors.CustomColors.ColorGray);
MyProgressView.ProgressTintColor = CustomColors.CustomColors.GetColor(CustomColors.CustomColors.ColorBlue);
问题是,当我从纵向到横向旋转装置,只有progressview就会消失。同时下一个按钮在那里,进度视图和下一个按钮都有相同的Y !.
如果我停止使用MyProgressView.ProgressTintColor
我可以看到旋转后的进度视图,但没有缩放。
任何想法如何解决它?
这是我讲的是UIProgressView:
它将如果使用更好的自动版式。 –
newFrame.Location = new CGPoint(0,NextButton.Frame.Y + you Buttons height)。试试这个 –