Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to change width/height of a widget programmatically? [duplicate]

Tags:

android

Possible Duplicate:
Android: How to resize a custom view programmatically?

What's the best way to change width/height of a widget (I mean, a UI widget, subclass of android.view.View) programmatically?

Doing something like this works, but it doesn't seem quite right:

ViewGroup.LayoutParams params = mSomeView.getLayoutParams();
params.height += 10;
mSomeView.setLayoutParams(params);
like image 308
synic Avatar asked Jul 16 '10 13:07

synic


1 Answers

I've been using this approach when to change LayoutParams attributes and it seems good enough for me. After googling i haven't found any other good way to do this.

like image 175
Mojo Risin Avatar answered Sep 22 '22 05:09

Mojo Risin