Yeah, it create two view special for animation, that is complex, is not a good solution for a lot of forms.
I means that one ViewController split a unit like as xcode UIViewController , and NavController can push or pop viewcontroller.
I see all demo, I found all UI Viewcontrollers must be in a form ( TDPFNavigationController, TDPFUIPageViewController), means a lot of codes must be in one unit, and be created while running, whether or not be used.
I know has a form/frame properity to split other unit, but it's difficultly to communication with NavigationController.
Has anybody a good advise?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Create a MainForm, this should be a TForm. Put a NavController on it, add some page, and do not put anything on any page. Now create a TFrame for each page. For example, your NavController has PageA, PageB and PageC, then create FrameA, FrameB and FrameC. Design your frames and put their code to their unit. You can create a global helper unit to hold the Frames' variables.
If you have to do something with any of your page outside of its own unit, just do this:
usesGlobals;FrameA.Label1.Text:='Hello from PageA!';
After you have set up this, you can easily call NavController.PushViewController or PopViewController.
Don't forget to set the PageIndex to 0 on the page you want to be the first.
By this, every page has its on unit, you don't have to put everything in one form. On the other hand, Frames are faster to load and consume less memory, so try to use them istead of Forms.
I hope it helps.
Greetings
PS.: I wrote it from mind, I don't have here Delphi now, maybe you can find some mistakes. If yes, report it, and I'll check it.
Last edit: Fenistil 2014-03-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks Fenistil. that is good.
I think better method, page design split to another unit, create on demand. register TDPFNavigationControllerPage as a component:
how to use?
a unit include frame, add TDPFNavigationControllerPage to this frame, coding...
in main form,
var
NavController: TDPFNavigationController;
Frame1: TFrame1;
Frame1:= TFrame1.Create(self);
NavController.PageIndex:= NavController.Count; // if no this line, will raise error
Frame1.NavigationControllerPage.Parent:= NavController;
Frame1.NavigationControllerPage.Loaded;
but has a bug, the bar buttons of TDPFNavigationControllerPage not be displayed.
Last edit: Johnson 2014-03-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I hope from A form switch to B form has a animation same as NavigatorController.PushViewController() .
how to do this?
sorry to my poor english.
Hi!
Please check the FormWrapSlideTransition Demo!
Greetings
Yeah, it create two view special for animation, that is complex, is not a good solution for a lot of forms.
I means that one ViewController split a unit like as xcode UIViewController , and NavController can push or pop viewcontroller.
I see all demo, I found all UI Viewcontrollers must be in a form ( TDPFNavigationController, TDPFUIPageViewController), means a lot of codes must be in one unit, and be created while running, whether or not be used.
I know has a form/frame properity to split other unit, but it's difficultly to communication with NavigationController.
Has anybody a good advise?
Create a MainForm, this should be a TForm. Put a NavController on it, add some page, and do not put anything on any page. Now create a TFrame for each page. For example, your NavController has PageA, PageB and PageC, then create FrameA, FrameB and FrameC. Design your frames and put their code to their unit. You can create a global helper unit to hold the Frames' variables.
Now in your main form's OnShow do this:
If you have to do something with any of your page outside of its own unit, just do this:
After you have set up this, you can easily call NavController.PushViewController or PopViewController.
Don't forget to set the PageIndex to 0 on the page you want to be the first.
By this, every page has its on unit, you don't have to put everything in one form. On the other hand, Frames are faster to load and consume less memory, so try to use them istead of Forms.
I hope it helps.
Greetings
PS.: I wrote it from mind, I don't have here Delphi now, maybe you can find some mistakes. If yes, report it, and I'll check it.
Last edit: Fenistil 2014-03-05
thanks Fenistil. that is good.
I think better method, page design split to another unit, create on demand. register TDPFNavigationControllerPage as a component:
edit DPF.iOS.Reg.pas,
procedure Register;
begin
RegisterComponents(.., [.., TDPFNavigationControllerPage, ..]);
...
end;
how to use?
a unit include frame, add TDPFNavigationControllerPage to this frame, coding...
in main form,
var
NavController: TDPFNavigationController;
Frame1: TFrame1;
Frame1:= TFrame1.Create(self);
NavController.PageIndex:= NavController.Count; // if no this line, will raise error
Frame1.NavigationControllerPage.Parent:= NavController;
Frame1.NavigationControllerPage.Loaded;
but has a bug, the bar buttons of TDPFNavigationControllerPage not be displayed.
Last edit: Johnson 2014-03-08