Screens

Virtual screens

Before you add a real screen (for example, Screen1, Screen2), think about it: is this screen necessary? Can it be replaced with other methods? When you add 10 or more real screens, your app will probably crash. A good way to prevent this is to use Virtual Screens. They're not really screens, they only act as screens. You can hide and reveal them in your app. I'll show you a demo.

Virtual screens are mostly made up of a layout component called a vertical arrangement. Vertical arrangements align components inside vertically.

On the top, we have two Vertical arrangments. VerticalArrangement1 is in red and VerticalArrangement2 is in blue for identification later. Each have a button (Button1 in red and Button2 in blue) to continue to the next screen. But did you notice - 2 screens are showing up at the same time? We have to make them show different times. Here is the blocks:

You can use them in other functions too, like showing popups, etc.

Preview your app on iPhone X

  1. You must be on appinventor.mit.edu. code.appinventor.mit.edu is not accepted.

  2. Open your project.

  3. In the Properties of Screen1, go to Theme and select Device Default.

  4. On the top of the phone, you see a new dropdown. Select 'iOS 13 devices'.

  5. Done! Demo on the right.

screen-capture (2).webm