在ViewController中添加了这些属性。我不想触摸appdelegate,navigationController。我还研究了许多stackoverflow的问答,但没有解决我的答案。
constructor TProgressBalken.Create(AOwner: TComponent);
begin
inherited;
...
Balken := TRectangle.Create(self);
Balken.SetSubComponent(True);
Balken.Stored := False;
...
labelx := Tlabel.Create(self);
labelx.SetSubComponent(True);
labelx.Stored := False;
...
end;
这些是viewDidLoad
public override var shouldAutorotate: Bool {
return false
}
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .portrait
}
public override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
return .portrait
}
如果它被Superview覆盖了怎么办?