tags:

views:

91

answers:

1

Hi guys.

How to change the size of LinearLayout when it is runtime ?

I've set the size dynamically when it is runtime. But no luck. Didn't change the size of LinearLayout.

How to code it ?

Thanks in advance.

A: 

The size is determined by the LayoutParams connecting the LinearLayout with its parent.

CommonsWare
I am using following code to set the size of LinearLayout when call public void onCreate(Bundle savedInstanceState);LinearLayout.LayoutParams layout = new LinearLayout.LayoutParams(w, h);layout.height = h;layout.width = w;linearLayout.setLayoutParams(layout);linearLayout.setYardageActivity(this);Above code worked fine at first time. Then when it is runtime, called above code again. No luck. It were same size like its old.Can you suggest any coding to correct the above code ?Thanks.
Guys any suggestion ?