无法激活预览模式Android Studio

时间:2022-01-29 23:31:42

I am trying to switch over to the new Android Studio (awesome btw) but I can' activate the "Preview" window to view my XML files like they demo'd in I/O.

我正在尝试切换到新的Android Studio(真棒btw),但我可以'激活“预览”窗口来查看我的XML文件,就像他们在I / O中演示一样。

When I navigate to View-->Tool Windows-->Preview 'Preview' is greyed out and I can't select it.

当我导航到视图 - >工具窗口 - >预览'预览'时显示为灰色,我无法选择它。

Does anyone know a fix for this?

有谁知道解决这个问题?

3 个解决方案

#1


2  

I had the same problem. Then I chose a different device. I saw the error window with the ability to click "rebuild". I clicked and it worked. Try it.

我有同样的问题。然后我选择了另一种设备。我看到了错误窗口,可以单击“重建”。我点击它,它工作。尝试一下。

Screenshot here

截图在这里

#2


2  

Had the same problem, this solution worked for me File - Invalidate Caches/Restart

有同样的问题,这个解决方案适用于我File - Invalidate Caches / Restart

#3


0  

Studio 2.2.1 / Build #AI-143.2821654, April 28, 2016.

Studio 2.2.1 / Build#AI-143.2821654,2016年4月28日。

Regarding: Missing the Preview Tab or grayed out Designer from View/Tool.

关于:缺少预览选项卡或从视图/工具中淡出设计器。

From the directory tree, click on the following directory to access activity_main.xml:

从目录树中,单击以下目录以访问activity_main.xml:

app/src/main/res/layout/activity_main.xml

or (depending on your directory structure, actual location may vary)

或(取决于您的目录结构,实际位置可能会有所不同)

app/res/layout/activity_main.xml

Afterward, you should notice the Preview tab to the right.

之后,您应该注意到右侧的“预览”选项卡。

To access Designer. You'll be able to find the Design|Text tab below your code.

要访问Designer。您将能够在代码下方找到“设计”|“文本”选项卡。

P.S. My problem was the Designer was grayed out. After the fix, the Designer from Menu bar/View/Tool Window/Designer is still grayed out. But you should be able to access the designer anyway.

附:我的问题是设计师灰显了。修复后,菜单栏/视图/工具窗口/设计器中的Designer仍显示为灰色。但无论如何你应该能够访问设计师。

无法激活预览模式Android Studio

#1


2  

I had the same problem. Then I chose a different device. I saw the error window with the ability to click "rebuild". I clicked and it worked. Try it.

我有同样的问题。然后我选择了另一种设备。我看到了错误窗口,可以单击“重建”。我点击它,它工作。尝试一下。

Screenshot here

截图在这里

#2


2  

Had the same problem, this solution worked for me File - Invalidate Caches/Restart

有同样的问题,这个解决方案适用于我File - Invalidate Caches / Restart

#3


0  

Studio 2.2.1 / Build #AI-143.2821654, April 28, 2016.

Studio 2.2.1 / Build#AI-143.2821654,2016年4月28日。

Regarding: Missing the Preview Tab or grayed out Designer from View/Tool.

关于:缺少预览选项卡或从视图/工具中淡出设计器。

From the directory tree, click on the following directory to access activity_main.xml:

从目录树中,单击以下目录以访问activity_main.xml:

app/src/main/res/layout/activity_main.xml

or (depending on your directory structure, actual location may vary)

或(取决于您的目录结构,实际位置可能会有所不同)

app/res/layout/activity_main.xml

Afterward, you should notice the Preview tab to the right.

之后,您应该注意到右侧的“预览”选项卡。

To access Designer. You'll be able to find the Design|Text tab below your code.

要访问Designer。您将能够在代码下方找到“设计”|“文本”选项卡。

P.S. My problem was the Designer was grayed out. After the fix, the Designer from Menu bar/View/Tool Window/Designer is still grayed out. But you should be able to access the designer anyway.

附:我的问题是设计师灰显了。修复后,菜单栏/视图/工具窗口/设计器中的Designer仍显示为灰色。但无论如何你应该能够访问设计师。

无法激活预览模式Android Studio