Android Layout Question regading tablerows:

Inside a relative layout I have a tablerow (amongst other items), in which I have a button and a textview.

Now the Thing I want to do seems simple if discribed in words: Inside the tablerow I have two culumns, in the first goes the button, in the second goes the text. Now I want to allign the Buttons to the left of the tablerow and the text to the right of the tablerow!

How on earth am I gona do that? I think I tried all the allignment and gravity options there are in the Android Studio, but none showed the result I desire.

Would anyone be so Kind to help me? Your help is very much apreciated Thanks in advance.

Here is an extract from the main.xml:

....

....

Post a Reply

Replies

use a LinearLayout and give it an orientation property of horizontal. inside it, make two more LinearLayouts.

for the first LinearLayout within the parent one, give it a property of gravity="left" or layout_gravity="left", and inside That layout put the button.for the second LinearLayout within the parent one, give it a property of gravity="right" or layout_gravity="right", and inside it put the textview.

i've pulled this information from my head, didn't test it, so it may not work, but i'm pretty sure it will.

also, code tags are broken, as you can see, so i suggest you to link me up with your code on pastebin.com

and my apologies, I thought, if I use the insert code button the forum enging would recognise the lines as code and print it and not treat it as a code ^^ so well never mind.

I almost feared such an answer, so I'll have to reorganice the whole lot of my layouts.I realy dont know why I could come up with the idea that if there is a tablerow, there might as well be a cell in it ^^

Thanks again, I think your Explanation is clear so I should be ok with it. If I mess up again, I'll come back