0

I want to write application where I create layout in the code (without xml-layout file). In the xml file I could write:

android:layout_width="fill_parent"

What should I write in the code? I look for something like:

LinearLayout ll = new LinearLayout(this);
ll.set?????? (????) ;
Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
tatiana_c
  • 948
  • 7
  • 16
  • 31

1 Answers1

3

You can check this out.

LinearLayout l = new LinearLayout(this);
l.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));

You can also check this out as an example

Community
  • 1
  • 1
Alok Kulkarni
  • 2,153
  • 19
  • 31