我正在使用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)。試試這個 –