Programmatically change the width of the Button in android

button.setLayoutParams(new LinearLayout.LayoutParams(10, 100));

Should have work for you.

There is one Awesome Example online for this : check this


you should apply LayoutParams of the ViewGroup that contains your View. That is, if your button is inside RelativeLayout, you should use RelativeLayout.LayoutParams

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)