I have this code like the example.
After loading the splash when you initialize pages the screen is black until the process finishes
- Is this behavior normal?
- Can I show the splash while loading all the pages and at the end to close the splash?
- What is the best behavior for the user?
[B4X] [B4XPages] Splash Screen
B4A, B4i and B4J splash screen implementation. The implementation is different in each platform. 1. Don't miss the manifest editor code in B4A. 2. Don't use %y in the code. Use Root.Height instead (you can use %y in the designer script).
www.b4x.com
B4XMainPage:
Public Sub Initialize
LoadData
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Wait For (ShowSplashScreen) Complete (Unused As Boolean)
LoadLayout
End Sub
Private Sub LoadLayout
Root.LoadLayout("MainPage")
'... code'
InitializePages
End Sub
Private Sub InitializePages
Settings.Initialize
B4XPages.AddPageAndCreate("Settings", Settings)
'...many pages over 20'
End Sub
Sub ShowSplashScreen As ResumableSub
#if B4i
Main.NavControl.NavigationBarVisible = False
Root.LoadLayout("Splash")
ImageView1.SetBitmap(xui.LoadBitmapResize(File.DirAssets, "logo.png", ImageView1.Width, ImageView1.Height, True))
Sleep(3000)
Root.RemoveAllViews
Main.NavControl.NavigationBarVisible = True
#else if B4A
Dim start As Long = DateTime.Now
Do While Activity2.HeightChangedFired = False And DateTime.Now < start + 5000
Sleep(150)
Loop
Root.Height = Activity2.CorrectHeight
#End If
Return True
End Sub
After loading the splash when you initialize pages the screen is black until the process finishes
- Is this behavior normal?
- Can I show the splash while loading all the pages and at the end to close the splash?
- What is the best behavior for the user?
Last edited: