SetWidth () Android Button
I created a button placed in a RelativeLayout and I would like to set its size. But I can only set it to a larger size than the original one, for example I can resize it to 200dp but not 20dp.
Is there a solution?
Here is my code
Button b = new Button(getApplicationContext());
myLayout.addView(b);
b.setWidth(200); // Work
b.setWidth(20); // Don't work
thank
+3
source to share