Design/Text tab is not showing only for drawable resource files - android

I am new to Android studio Text/Design Tab Missing for only XML file created in drawable resources folders and yes I've tried invalidate cache/restart option but it is not working
Activity.xml ScreenShot:
Button.xml ScreenShot:

You can find Preview on the right side of the window:
Or you can enable this window using menu:
View -> Tool Windows -> Preview:

Design/Text tab is intended for designing layout XML resources only. And the drawables XML resources are not same as layout, they are mostly defined as selector, shape, etc which never contain any UI elements like TextView, ImageView which needs to be designed. So Android Studio doesn't feel it necessary to put that Design/Text tab for drawables XML resources too.
However you can try using the Preview option to have your work preview, as #Boken mentioned in the another answer.

Related

Toolbar not showing in the layout editor of Android Studio 3.6.1

After updating android studio to 3.6.1 Toolbar not showing in the layout editor.
It's showing like this..
But it should be like this.
Number 3 Option not showing in my case.
Ok as far as I think there's no option to show or hide the specific toolbar you are mentioning in your question. Android Studio seems to be doing it by default.
The issue in your case is that android studio will show the toolbar if you open the any layout.xml inside the layout folder in your res folder. Try opening an xml inside layout it should be showing this by default.
As visible from your screenshot you have opened an xml from menu folder. The layout editor in this case only shows the contents in your main_menu.xml like a dropdown list etc. and not how it appears in the actual layout if I am not wrong.
If this menu is include in some layout's xml file in the layout folder try opening that to see the contents and the toolbar you mentioned.
See if this works for you

How to show menu layout in mainactivity layout in the preview window in Android Studio?

I am making a custom menu with icons and I want to know if its possible to see how the menu on the toolbar looks without running the program on the emulator nor on a android device.
I'm wondering if this can be done the way you can temporarily preview things by including the tools namespace:
xmlns:tools="http://schemas.android.com/tools"
in your layout file. Then you would just put something like either of these:
tools:text="text here that is previewed only"
tools:layout="#layout/some_layout"
So can I do this with a menu resource file? Because when I make the menu file I want it to show the formatting of my theme. I tried messing around with different tools attributes and tried to set it to my menu file but nothing was working. Here's how it looks currently because I can't see the layout with my theme settings:
If that's not possible, can I see how the menu looks with my theme settings in another layout file?

When I opened the layout file in eclipse with Android common XML editor,there is only one view mode shown to me

The option bar at the bottom doesn't exist.
I can only use the graphical layout view mode,unless I select the xml file to open with other xml editor.
So,how can I fix that?
Thanks!
update:
In fact, I can use the hot key "shift+alt+f7" to switch the view mode between graphical layout and xml editor, while there is no option bar at the bottom.
update2:
Finally,I find the cause of the problem.
This problem turned out to be a side effect of the Dark Juno theme.
reference:
How do I force eclipse to show xml layouts and styles as text?
Right click on any of the layout files in the package explorer(on the left), right click -> Open With -> Android Layout Editor

eclipse Android Xml file design view

my Android xml fle Design look like this.
but i want to view like this so how can do this?
Right click on xml and select open with -> Android XML Resources Editor and also
you can try open with -> Android Layout Editor to have Design Layout tab.
I also faced this problem earlier for all xml files but not for manifest file ,now it resolved
in my application our requirement is When the orientation of the activity changes place the appropriate land folder and xml files.in that we give wrong naming conventions for the layout folders instead of layout-land,layout-land-hdpi,layout-land-mdpi,layout-land-ldpi,layout-port,layout-port-hdpi,layout-port-mdpi,layout-port-ldpi when ever we correct the naming conventions it comes normally.

Android XML editors broken in Eclipse

Until today (I have no idea what I did to cause this), if I double-clicked an android XML file, then the correct editor would appear.
For example, double-clicking a layout file would open a Graphical Layout tab and a tab with the XML contents for direct editing (named as the file being edited). Now all I get is a Design and a Source tab!
I am unable to preview the layouts I am editing (this is the same as here: Graphical Layout tab does not appear for some layout files into Eclipse)
That link also gives a 'workaround' in that I can right-click the file and open with the right editor, but this isn't a solution!
How can I sort this permenantly? I have re-installed fresh Eclipse, ADT to no avail (haven't used fresh SDK... will that matter??).
** Note this happens to all Android XML files, not just layout ones I mentioned above! **
Yes this may be a permanent solution:
Select any XML layout file
click on Window->Preferences menu.
Follow steps as mentioned in attached image.
What I had to end up doing was selecting the Legacy Android Xml Resources Editor from the same list that Paresh is showing and setting it as the default. I had to choose it from the list that appears when you click the add button. After that I restarted eclipse and everything was fine.

Categories

Resources