tags:

views:

48

answers:

2

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);
+1  A: 

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.

Mojo Risin
A: 

Yes same here. A bit disappointing compared to other UI technologies

sacchetto