One layout pushes the other one off the screen
Currently i'm working one a small android project. I ran on a problem with
layouts because I must create a user interface in Java. I have 2 layouts
first is the LinearLayout with horitontal orientation and the other is a
TableLayuot. I set the width MATCH PARENT and height WRAP CONTENT for both
of them but the first one pushes the other one off the screen and I want
the first layout to push the other one under him.
The code looks like this:
LinearLayout mainLayout = new LinearLayout(this);
LinearLayout hLayout = new LinearLayout(this);
hLayout.setOrientation(LinearLayout.HORIZONTAL);
TableLayout table = new TableLayout(this);
LinearLayout.LayoutParams params = new
LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
table.setLayoutParams(params);
mainLayout.addView(table);
setContentView(mainLayout);
No comments:
Post a Comment