简体   繁体   English

在 Android Studio 4.0(Canary) 中找不到预览 window 的位置

[英]Can't find where the preview window is in Android Studio 4.0(Canary)

I'm going through the tutorials about Jetpack which is ran in the Android Studio 4.0(Canary), please refer to the link post below.我正在阅读有关在 Android Studio 4.0(Canary) 中运行的 Jetpack 的教程,请参阅下面的链接帖子。

https://developer.android.com/jetpack/compose/tutorial https://developer.android.com/jetpack/compose/tutorial

Everything is ready except I can't find the preview window since I try to preview the "Composable" method.一切都准备好了,除了我找不到预览 window 因为我尝试预览“可组合”方法。

Can someone give me an exact hint that where the preview window is?有人可以给我一个确切的提示,预览 window 在哪里?

Check the 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. 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.主要限制是,可组合的 function 不能带任何参数。 Add the @Preview annotation before @Composable .@Composable之前添加@Preview注释。

Then select on the top-right the Editor and Preview toggle.然后 select 在右上角的编辑器和预览切换。

在此处输入图像描述

在此处输入图像描述

To update the preview click the Build Refresh button.要更新预览,请单击Build Refresh按钮。

在此处输入图像描述

You have to build the project first (Build -> Make Project).您必须先构建项目(构建 -> 制作项目)。 I also had to restart Android Studio in order for previews to start working.我还必须重新启动 Android Studio 才能开始预览。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Android studio 4.0 Canary 中预览可以显示或无法在预览中显示内容之前需要成功构建 - A successful build is needed before the preview can be displayed or can not show content in preview in Android studio 4.0 Canary Android studio canary 不预览 jetpack compose - Android studio canary doesn't preview jetpack compose 有没有办法在 Android Studio 3.6 canary 9, 10 中显示浮动布局预览窗口 - Is there a way to show floating layout preview window in Android Studio 3.6 canary 9, 10 Android Studio 4.0,在 SDK 管理器中找不到 LLDB? - Android Studio 4.0, can't find LLDB in SDK-manager? Android Studio在M预览中找不到Aapt - Android Studio can't find aapt in M preview Android Studio 1.3预览版的NDK示例:找不到标头 - NDK samples with Android Studio 1.3 preview: can't find headers 在哪里可以找到适用于最新版 Android Studio 的金丝雀版本的 android gradle 插件? - Where do I find android gradle plugin for the latest canary build of Android Studio? 无法从 Android Studio 4.0 Canary 拉/推 git - Cant pull/push git from Android studio 4.0 canary Android Studio 3.0 Canary 4 UI预览中缺少类 - Missing classes in android studio 3.0 canary 4 ui preview Android Studio Preview 4.1 Canary 10 中的构建错误 - Build Error in Android Studio Preview 4.1 Canary 10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM