I installed Android Studio, but when I edit my layout files, I can't find live preview! I just see an XML file. How can I see my layout in graphical view?
Update: This is how it looks like in my case:
I installed Android Studio, but when I edit my layout files, I can't find live preview! I just see an XML file. How can I see my layout in graphical view?
Update: This is how it looks like in my case:
As etienne said be sure that the XML file you are looking at is in
src/main/res/layout
I had the same issue. If you're in a layout file in
build
directory, you won't see a preview, nor will you have it as an option to enable. I wish Google had a slight warning for it.File>>setting>>Compiler>>JavaCompiler At "Project bytecode version(leave blank for jdk default):" choose your jdk.
I found 2 quick options to fix this:
Happy coding!
If you want to see the live preview, in the right part of the screen you should have a button call Preview that show/hide the live preview.
If what you want is to use the WYSISYG editor mode, in the bottom of the editor there is a tab that switch between XML mode and WYSISYG mode.
This works in the same way both in IntelliJ and Android Studio.
Navigate to file -> Project structure -> modules -> click on green plus button to add a module.
Select new module -> select Application Module in Android option -> give a module name -> next -> next -> finish
Select project that to be include in module -> click apply -> okay
Now you will be able to see the full project structure; then open the module form project window (the left panel), select res then select layout -> your layout name(.xml).
Now you will be able to see the design view and text view both...
You should have a
Design
button next to theText
button under the xml text editor:Or you can use the
Preview
button in the upper right corner to add a preview window next to the XML code:UPDATE:
If you dont have it, then do this:
View
->Tool Windows
->Preview