Jetpack Compose手机屏幕布局预览

12

我刚接触Jetpack Compose,创建了一个应用程序,但只能预览单个视图,例如文本视图。

如何预览整个屏幕而不是单个元素?enter image description here

我需要像这样的效果:enter image description here

我正在使用Android Studio 2020.3.1 Canary 8。


只需构建一个具有更多元素的可组合函数。 - Gabriele Mariotti
1
但是我在屏幕预览中看不到它们。我想要像这样的东西 https://blog.novoda.com/content/images/2016/10/Screen-Shot-2016-10-12-at-12-16-24.png - Valentin
1
使用@Preview(showSystemUi = true) - Gabriele Mariotti
1个回答

25

使用注释@Preview(showSystemUi = true)

这里有关于预览注释的更多信息。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接