iOS Question how to get smooth transitions between pages

marcick

Well-Known Member
Licensed User
Longtime User
I'm working to make a more professional look to my app.
When you switch between pages, the first time the transition is not very smoot, you can see some "bumps" of the graphics. This is I suppose because the page need to be initialized and layout loaded.
Then, when you come back to a page that has been already initialized the transition is perfect.
I see some professional apps that does not behave like this and has perfect transitions also the first time. WhatsApp for example.

Which tricks can be adopted to obtain this ?
I tried to initialize all the pages when the app starts but no success.
I attach a zip. What I say is minimal but visible. When the layouts become more complexs the effect is much more evident.
 

Attachments

  • Test.zip
    6.3 KB · Views: 138

Erel

B4X founder
Staff member
Licensed User
Longtime User
I haven't tested your project but it sounds like the dumping effect.

Set the dumping ratio to 1.

1676537583204.png
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
With damping ratio 1 the effect is no more visible on the simple test project above, but still present on a more complex layout.
I've made a video
 
Upvote 0

ilan

Expert
Licensed User
Longtime User


 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Yes, I would like but how to ? ....
In Page2, I have created a sub "Loadlayout"

B4X:
public Sub LoadLayout
    If Page2.IsInitialized=False Then
        Log("loading layout")
        PageConfig.Initialize("Page2")
        PageConfig.RootPanel.LoadLayout("Page2")
    End If   
End Sub

I call it at startup from main.
But no difference. When I show Page2 I see that problem
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I want so much but I had difficulties porting the old project in B4x, mainly because I don't understand which part of the actual Main code should be transferred to the new Main module (timers ? notification events ?) and which ones to the new MainPage. I had so many fail and crash and then abandoned.
I will try again. I understand that it's becoming a must.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Well, all the tricks tryied, sleep, delay timer etc but no difference. Looks like the layout is really loaded only when you show the page the first time and not when you "LoadLayout".
Also the toolbar elements fall down from top to the bottombar but only the first time you show the page.
I will try with B4xPages.
Thank you ?
 
Upvote 0
Top