我正在阅读有关在 Android Studio 4.0(Canary) 中运行的 Jetpack 的教程,请参阅下面的链接帖子。
https://developer.android.com/jetpack/compose/tutorial
一切都准备好了,除了我找不到预览窗口,因为我尝试预览“可组合”方法。
有人可以给我一个确切的提示预览窗口在哪里吗?
最佳答案
查看official site :
Beginning with Android Studio 4.0 Canary 1, Android Studio lets you preview your composable functions within the IDE, instead of needing to download the app to an Android device or emulator. The main restriction is, the composable function must not take any parameters. Add the
@Preview
annotation before@Composable
.
然后选择右上角的编辑和预览 切换。
要更新预览,请单击 构建刷新 按钮。
关于android - 在 Android Studio 4.0(Canary) 中找不到预览窗口的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58621252/