Layout orientation in code

后端 未结 6 1062
暗喜
暗喜 2020-12-25 09:38

I have this code in my application:

LinearLayout.LayoutParams params =
    new LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);

and I

6条回答
  •  长情又很酷
    2020-12-25 10:03

    Simply use as follow :-

    LinearLayout mlayout = new LinearLayout(context);
    mlayout.setOrientation(2);
    

    2 means Vertical, 1 is used for horizontal.

提交回复
热议问题