I built an app from the Android Studio template using the new Compose feature (official docs).
The Preview looks like the following:
However, when I run the application, it looks like this (text is much smaller & is not centered in the View):
Is that not an actual Preview of the UI in the editor? Is there a way to do a true preview of Compose in Android Studio?


Jetpack Compose Preview shows only the elements contained in the function that has the annotation, not the entire device display.
You set the
@Previewon the Greeting function, which contain just aText()element, and that's what you got in the preview panel.You can wrap your
Textwith aColumnorBoxand tell Compose to fill the entire screen with amodifier.Note that even on your device, the text does not fill the entire screen, it is only placed in the first available space. Everything works fine.