Comment faire pour résoudre le problème de résolution

Ah, now I understand :thinking:

The App Inventor Designer only roughly represents the Smartphone Screen:

  1. Usually, the screen resolution of a Smartphone is much greater than a desktop PC or Laptop.
  2. Smartphones are all shapes, sizes and resolutions.

So, you can place sprites initially in the App Inventor Designer Window, but with some phones those positions could be a long way out.

We can tackle this design problem in two ways (note, I'm not talking about the 6 Nations rugby :grin:):

  1. We can set the size of the canvas in pixels - however for "one size fits all phones" the canvas has to be relatively small. If that's OK for your App, job done.

  2. A different approach is to allow the Canvas to be sized in percentages %. This means it will be a different size on different phones but it will be a good size on most.

  • but how then do we know where the sprites should be placed? At run-time, we need to verify the actual size (in pixels or dp) of the canvas and then via code Blocks, we can place the sprites accurately. My fellow Power User Anke has made an extension that serves this purpose perfectly: