Re-enable “component tree” in Android Studio

我是研究僧i 提交于 2020-03-17 04:17:11

问题


After updating to the last version (1.4 Beta 2) in Android Studio, the "component view" in the layout editor disappeared. How can I enable this tool again?


回答1:


If you are looking for the component tree, go on the bottom left of Android Studio then click on the square (the one who show/hide the tool on the left, bottom and right) then on Designer. A new tab should be on the right part of android studio, with gradle and maver project.




回答2:


I lost mine too, and then realized that they just moved it to the left side of the screen in the latest Android Studio 2.2 Beta 2. It took me a good 10 mins to find it.




回答3:


A simple way of doing this --> just press shift+F12. If this does not work then, go to windows menu --> Restore Default Layout.




回答4:


  1. Close Android Studio;
  2. Open [PROJECT_PATH]/.idea/workspace.xml
  3. Search for "PropertiesComponent"
  4. In this xml node, erase this 2 lines:

    <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager2.WIDTH" value="1" />
    <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager2.STATE" value="left" />
    

For some reason, the width of ComponentTree was set to something almost invisible, and this was what worked for me.

If this doesnt work, just replace the whole node:

    <component name="PropertiesComponent">
         <property name="settings.editor.selected.configurable" value="gradle.compiler" />
         <property name="settings.editor.splitter.proportion" value="0.2" />
    </component>



回答5:


It's now called Structure on the left panel. I am using

Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

See my snapshot below:




回答6:


In Android Studio 3.2.1, I too momentarily lost the Component hierarchy view. This could be a bug, where when you switch to XML mode, and then tap on the preview button on top right, it takes you to the preview mode, but the pallette, component hierarchy, etc remain hidden. To remedy, this, go back to XML mode, in the bottom you can see two tabs, namely Design and Text, tap on the 'Design'. Now you should be seeing the palette, component hierarchy and also the preview. Check the following images for illustration.




回答7:


Close your XML File, and re-open it! That's it!




回答8:


You just need to change the device




回答9:


click on the Windows and select Restore Default Layout, close and reopen the activity. The Palette and the component 3 will come auto




回答10:


I had encountered this problem after moved the project location to some other folder. I tried to clean up the workspace.xml and .idea folder. But Failed. I just closed the project and imported the project once again. It worked for me!!!



来源:https://stackoverflow.com/questions/32483917/re-enable-component-tree-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!