Menu

Having problems creating a TDPFUIViewController at runtime.

Paul
2014-05-19
2014-05-20
  • Paul

    Paul - 2014-05-19

    Hi,

    If I drop a TDPFUIViewController on a form at designtime then assign the frame at runtime everything works as expected.

    If I create a TDPFUIViewController at runtime with the following code, I only see a black form when run on the iOS simulator.

    procedure TMyForm.FormCreate(Sender: TObject);
    var
    DPFUIViewController: TDPFUIViewController;
    begin
    DPFUIViewController := TDPFUIViewController.Create(Self);
    DPFUIViewController.Parent := Self;
    DPFUIViewController.Align := TAlignLayout.Client;
    DPFUIViewController.Frame := TIOSMain;
    end;

    Do I need to assign some other properties to TDPFUIViewController?

    Cheers,
    Paul

     

    Last edit: Paul 2014-05-19
  • Diego

    Diego - 2014-05-19

    Off the top of my head, I think you need to put DPFUIViewController.Loaded; before assigning the frame.

    I am not right now on my computer to check it...

     
  • Paul

    Paul - 2014-05-20

    Thanks Diego, that did the trick :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.