简体   繁体   中英

Eclipse Not Showing Graphical Layout for Android XML files

I had a HD hardware failure the otherday and have been trying to recreate my Android programming environment.

I have installed Eclipse and the Android SDK. I have updated the SDK to the latest version.

I then imported my project from my backup folder. When I look at my layout files in eclipse I cannot view the Grphical.layout as its not an option. I get the following tab options for the page (Design or Source).

However my old environmet which i have a copy of in a virtual machine gives me following tab options for the layout file (Graphical Layout or filename.xml)

Any ideas why this is occuring? I assume it must be something to do with eclipse not realising that its menat to be looking at android xml layout files.

Please help,

Iain

漫画如果没有通过打开xml文件显示图形布局尝试在xml文件上使用OpenWith - >布局编辑器,你想从res文件夹下的项目浏览器打开

If the above answer doesn't work and if you cannot see the option of 'Layout Editor' on right click, restart eclipse. Worked for me.

有时图形布局show.but什么都没有显示。只是空白。这是因为清单最小sdk不支持查看布局。解决改变显示在布局显示区域右角的api级别。

I tried the option suggested by Muni, but did not work. Then I noticed that the Android version in the Graphical Layout was higher than what I had selected for my project which was causing the issue. After setting it to appropriate version it worked fine.

I had same problem with ADT eclipse. Probably this happens when you change something with your editor like changing themes. Need not to worry about this, here I have solution for your issue it to navigate with your xml sourc and xml Layout files as for displaying Graphical Layout use this keyboard shortcut. Shift+Alt+F7 and for navigating with source editor of xml file use this shortcuts as Alt+F7 Thanks for such good question. hope my answer will useful for all those are stuck with this.

I was facing this problem but that didn't get corrected by restarting. Actually, my xml file say "MyFile.xml" was present in a sub folder of layout and in the layout folder itself(root). When i opened "MyFile.xml" from the subfolder it just showed the code. When i opened "MyFile.xml" directly from the layout folder(not from itz sub folder), it showed both the design and code.

:p that was my blunder!

Just follow this pattern : Package Explorer ---> res --> Layout ---> activity_main.XML Open activity_main.XML

May 2013

just open with regular xml editor and put them side by side. 'right click' open with xml editor, and drag it so the windows layout side by side.

My problem was that I installed everything and restarted eclipse. But I didn't go back to. Window | Android SDK manager.

When I did that I saw that eventhough I had installed everything and the SDK worked just fine. There was another 3 packages left to install. I installed that (and some sample code). Restarted Eclipse and everything worked like a charm.

This Question was asked 3 year ago, I am sure that you have get your solution, however i was also facing the same problem but got the solution in eclipse, here it is:-

1)Goto help->AboutEclipse->Installation details.
2)check the version of Android DDMS, Android development tool, Android hierarchy viewer, Android native development tool, Android trace view and tracer for openGl ES in installed software tab.
3)If they have different version than you have to update all of them.
4)Goto help->check for update in eclipse and follow the instruction.
5)Then restart eclipse.

This solve my problem.

From the upper right corner try a different "Android version to use when rendering layouts in eclipse". (Small green android icon). This worked for me.

If you can't see "Android Layout Editor",
right click on an xml layout file and choose Open With | Android Common XML Editor then choose Graphical Layout tab.

See here

If the above solutions doesn't fix the problem , then remove the very first line that is autogenerated while creating the xml file and select some theme like "No Title Bar" or other. Your problem will be fixed.

I am doing only

  1. WORKSPACE ALL CONTENT DELETE
  2. INSTALLED adt-bundle-windows-x86-20131030 USED
  3. ECLIPS DOUBLE CLICK

MY PROBLEM SOLVE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM