In my Android App (for landscape screen orientation) I need to place widgets to two relative layouts, one on the left of the screen, and one at the right (to fill the full size).
I prefer working programmatically (I find it more flexible than xml).
Shoud I better use a TableLayout as the parent layout fro my sub-layouts?
Answering my own question:
Method suggested by alextsc didn't work, since RelativeLayouts (contrary to LinearLayouts) do not have any weight.
I did resolve with this (ugly :-() hack:
For just two
RelativeLayouts
next to each other you have plenty of choice to archieve that. A horizontalLinearLayout
would be the easiest in my opinion.Edit: I never do layouts in code, but since you probably read a lot of docs with XML you should be able to translate this example. Uses a 50/50 space distribution for both layouts.
Edit 2:
Definitely works, just tried this: