I have an fairly well established app (getting there) and I'd like to introduce a splash screen using the above method which makes complete sense in simple terms.
My issue is this:
My main interface is held in a vertical arrangement. I make this not visible by default and the splash screen visible by default. Once an image has loaded within the hidden vertical arrangement (actually, a horizontal arrangement within the vertical arrangement), I make the splash screen canvas not visible and make the main vertical arrangement visible.
Problem is - not all of the elements held within the main vertical arrangement re-appear. The most noticeable omission are all the buttons. None are appearing. And similarly, the code I use to close the splash screen canvas is a display image routine - it works to make the splash screen canvas not visible, and make the main screen arrangement visible, but the subsequent image is not displayed.
There is a switch element and text in the hidden arrangement that becomes visible, but these appear as expected. The switch operates and executes the appropriate code.
If the main screen vertical arrangement is not visible, does that have some kind of impact on the way the screen setup routine works? Particularly to do with the buttons which do not reappear?
Perhaps the ImageViewer extension needs the element it uses to hold the images to be visible as part of its operation? This is that extension:
The image loads via the DisplayImage routine using the ImageViewer1.path command. The lines of code just prior to this is where I switch the splash canvas off and the main screen arrangement on.
My guess is that that some of your setup procedures in screen1.initialise are not able to perform successfully while your main vertical arrangement (VA) is not visible. Try moving them to after you make the VA visible.....
I understand that, but try as suggested and see if that resolves your problem. At least then you will know what the issue is. You may be able to do something by having your VA visible and load it below (not behind) the canvas (out of sight but visible), then when you hide the canvas your VA moves into position ?
I set the SplashScreen_Arranagement to Fill Parent for both height and width:
I set the MainScreen_Arrangement to Automatic Height and Fill Parent Width:
However, this is how the arrangement appears (phone snapshot taken before the main image had loaded, when the SplashScreen_Arranagment should be filling the screen.
You can see how the SplashScreen_Arranagement only appears as a small band along the top of the screen.
Any ideas? I had previously used the Canvas method instead of the arrangement method for the splash screen, but the canvas refused to become not visible through code!
Is it perhaps because the MainScreen_Arranagement is aligned to bottom? I tried changing this to Top, but it made little difference. The SplashScreen_Arranagement band becomes marginally higher, presumably due to the difference in the overall height of the MainScreen_Arranagement and the physical screen height:
I recommend you play around with this so that you get an understanding of how things can work for you. Note the screen scrollable checkbox is unticked!
Change the visibility of one or more VAs and see what happens
Fix the height of one or more VA and see what happens, also with 1. above
Place some fixed size components in one or more of the VAs and do 1. and 2. and see what happens
carry out any other tests you need to try
Set it up as you want for your app, if this works then apply those settings to your app
Setting the height to 0 pixels seems to keep it "visible" although you can't see it, and therefore i'm also not getting any issues with the buttons disappaearing or the image not loading.