I have created a Button programmatically but I have to set its layout_width. How can I do this?
Wich paclages I have to import?
Printable View
I have created a Button programmatically but I have to set its layout_width. How can I do this?
Wich paclages I have to import?
First off all it's not a good idea setting layout programmatically.
Button button = new Button(this);
bt.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams .WRAP_CONTENT));