Unable to find UI designer in the new Android Stud

2019-02-05 19:50发布

问题:

I have downloaded the new android studio that has been released recently. I am unable to find the UI design preview for the xml, as it is in eclipse. Any help or suggestions on that?

回答1:

Open a xml layout file:

  • at the bottom, you have two tabs: Design/Text
  • in design mode, you see the preview directly
  • in text mode, the preview is (by default) on the right, toggled by a 'Preview' button in the rightmost bar

You can also show/hide it with View > Tool Windows > Preview

EDIT

Attention: the IDE only displays the preview if editing a layout file in the res/layout* directory of an Android project. In particular, it won't be displayed if editing a file in build/res/layout* since those are not source directory but output directory.

The Resource folder is set automatically, and can be viewed (and changed) in Project Structure > Modules > [Module name] > Android > Resources directory.