layout:row missing in Android studio - android

can anyone help with missing layouts?
I used ImageView , however I can't find field layout:row and also layout:columns in the Text or in the properties. missing layouts
enter image description here

There should be two tabs under the Design window, one labeled "Design" and another labeled "Text". In the text tab, you can edit the raw layout xml, i.e. by moving the ImageView's tag(s) to between the <GridLayout .... /></GridLayout> tags. This approach is, incidentally, applicable to most instances of the Design editor refusing to take your orders.

Related

Change default orientation of LinearLayout

I always forget to define android:orientation property to LinearLayout's in my layout-resources. Because of default value of layout's orientation (horizontal) I spent a little of time every time I forget about it.
Is there a way to override default orientation of LinearLayout (btw, I don't want to use custom view) in whole application?
I am also having same problem of every time writing that same line.
There are two ways you can do it:
Create CustomLayout which will extend LinearLayout. [which you and
me also don't prefer].
Create Live Template - A cool feature of Android
Studio.
Going for 2nd one(a preferred one):
Open Settings in Android Studio by File > Settings OR Ctrl+Alt+S
Navigate to Editor > Live Templates
Click on Add button on right side. And select Live Template
As we are creating template for XML, define applicable context as XML Text
Now fill details:
Abbreviation name will be your short name. Description is optional. Fill template text as this:
[you can set height or width as whatever you prefer]
Click DONE. That's it.
Usage:
Open any Layout xml file. And in Editor, just write your abbreviation which we set earlier.[you can also list out all available live templates by pressing Ctrl+J]
You will see a hint:
Just click on that, and there you go.
Your template text will be here:
[NOTE: In template text I have used $END$, which means after applying code text, the cursor will be placed at this point. For more Live template variables, please have a look at this link]
For more cool details about Live Templates: LINK
Hope, this will help you. You can also create lots of own Live Templates to make life easier. :)
if we create our own custom Linear Layout then it is compulsory to define it's orientation during coding of that layout. Otherwise it may be rise an error for it.

How do I copy xml layout and preserve all the ids in it? [android]

I need to make almost the same xml layout, except for some buttons, when i copy all the elements, the textviews, imageviews, buttons - all get same id! So i have to manually change the ids, i can copy 1 by 1 and each id name will be preserved.
But i am a programmer! Is there way to automate it, do it faster, more efficient?
example here , i copied half of the elements and they changed their ids automatically:
the answer is pretty simple actually: just switch to text tab in android studio, copy the actual xml code and paste it wherever you need, this way when you switch back to "design" mode - you will see all the ids in place!

Missing configuration drop down buttons in Graphical Layout editor

I have two xml layouts in my project in Eclipse and when i want to edit them in the graphical layout tab, only one of them has the configuration drop-down buttons in the section above the layout. I would post up pictures but I don't have high enough reputation yet.
It contains buttons to choose the type of phone/tablet you want to display on, the screen orientation, the Theme, associate activity etc.
I want both of them to have it but I'm not sure how to put it back. Does anyone know how to make it appear?
Thanks in advance

Editing multiple elements in Android XML layout via Eclipse

I am trying to edit multiple textview's in a xml layout. Before installing Juno, i was selecting multiple elements pressing shift button and all properties were shown on the Properties view, so i can make batch edits. Now all i have on Properties View;
ID,
Text,
Hint,
Text Color,
Text Appereance,
Text Size,
Content
In this particular case i want to change all their gravities from none to right. I guess i did something wrong with the eclipse preferences or missing something else.. need help thx
I just tested it with Eclipse 4.2.1. I opened an xml layout file, selected a bunch of TextViews, then did a right click and clicked "Properties". All attributes appeared in the properties view and I easily batch-edited them.

styling tabs using styles.xml

I have a row of 5 tabs at the bottom of my app. The problem is the text is cut off on some of them. I want to be able to have the text in each tab stack on top of each other instead of following along horizontally aswell as move the text into the center of the tab instead of sitting at the bottom.
I have created a styles.xml file and have altered the text size but I am not sure how to add the requirments I stated above to it. Can anyone help?
Thanks
The style resources uses the same XML attributes as an XML file. You altered the text size successfully, so just add the attributes for the other desired styles. If you don't know which attributes to use, just go to your XML file and type android: and your IDE should pop up a list of all Android XML attributes. If not, go to the View page and read up on the "XML Attributes" section.

Categories

Resources