I thought ADT should come with a visual editor for building GUI : Easy way to build Andr开发者_运维百科oid UI?
However, I just cannot find it. I was wondering where is the Visual Editor for Eclipse with the ADT plugin.
I can run HelloWorld application without problem. However, whenever I click on main.xml
at the left navigation tree layout folder, here is what I get. What I wish to get is a WYSIWYG editor.
Select your main.xml file. At the bottom of eclipse you can see a Layout tab, click on it and eclipse will open the android gui editor.
As Paul Kearny previously noted, to resolve issue with seeing "Design" tab instead of "Graphical Layout" follow these 2 steps:
1) Delete project from the left of the screen, without deleting the source files
2) File -> Import -> Existing Projects into Workspace, browse and select your workspace folder and open your project
Graphical Layout problem fixed!
If you want to edit the layout visually, rather than through XML, click on the Layout
tab at the bottom left of the main.xml window (in your screenshot, just above Problems
).
Also note, there are issues with displaying some of the widgets. For example, the ListView does not render. So, my hint is to change ListView to just a View, then work out the details of the layout so you can get the colors, relative-ness, etc. Then switch it back to ListView. There is one other widget that I cannot recall off the top of my head ...
To resolve issue with seeing "Design" tab instead of "Layout" or "Graphic Layout", I had to: 1. Delete the project from Eclipse without deleting the source 2. Shut down and restart Eclipse 3. Import the project back in
You could probably skip step 2, but I did it just to make sure.
Hope this helps anyone else who has the same issue.
If your view is showing Design|Source for the .xml file right click on the main.xml and select open with - android common XML editor. Simple.
If it is happening to one particular xml, you can delete the file (make sure you copy the content first), create new xml and paste the content again.
I recommend that any serious Android developer stay far, far away from Eclipse/ADT Design View. This is a time-wasting tool that sorely lacks the attention it would need from Google to make it worth serious consideration. It doesn't render the views as a real device would. There is no way to bind dynamic data. Does it work with fragments (I think not)? For it to work properly and have useful features would weigh down Eclipse further and make it unacceptably slow. In my very humble opinion, the entire strategy for ADT's ui-design tools has failed.
Thus, the recommendation is: edit Android XML layout files by hand and use the only reliable testing mechanism you have for layouts: actual devices. You can always fallback on the emulator - but the emulator performs 50x - 100x slower than an actual device. I'm not exaggerating. Pick your poison!
new fix, took me forever to get this fixed, really simple....delete the xml file and undo the deletion (ctrl+z), double click and there you go. Hope this helps someone as it did me. No shut down required.
If you see "Design" tab instead of "Graphical layout", just close the project and open it again.
精彩评论