12

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.

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?

hoss
  • 2,430
  • 1
  • 27
  • 42
easycheese
  • 5,859
  • 10
  • 53
  • 87
  • Closed eclipse and Android Studio and reopened Studio and it worked...probably Eclipse was interfering – easycheese May 19 '13 at 19:21
  • 1
    I have flagged this question as a duplicate of "http://stackoverflow.com/questions/16660039/where-is-android-studio-layout-preview/16825056" – Merlin -they-them- May 29 '13 at 22:41
  • 1
    This happens when you add a new resource fill to the same directory in which your XML file resides, just rebuild and the the problem will be solved. – Giridhar Karnik Jul 29 '15 at 19:13
  • I had this problem with my old laptop, I believe its was because of the resolution. – Shank Jun 02 '16 at 17:54

4 Answers4

3

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.

Screenshot here

buczek
  • 2,011
  • 7
  • 29
  • 40
Sergiy Shilingov
  • 127
  • 1
  • 14
3

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

SaravanaRaja
  • 3,228
  • 2
  • 21
  • 29
1

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

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:

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.

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.

Screen Capture

manfcas
  • 1,933
  • 7
  • 28
  • 47
Ricky Mau
  • 11
  • 3
0

What worked for me was changing the theme of the app.

Sometimes, parameters like Theme, Device preview, etc, can affect the preview although it may look well in the app.

Changing these helps. Can be accessed from design and text view.

Like these Params in Design View

Shachi
  • 1,858
  • 3
  • 23
  • 41