Android Forum » Android Developer Forum » Android Developer Forum » How to Creat a dynamic button ???

How to Creat a dynamic button ???

How to Creat a dynamic button ???
created on May 1, 2012 12:25:55 PM — modified on May 1, 2012 12:28:05 PM
Please help me !
I have a idea,
there are 2 editText (Enter weight and hight of button) and one button with name "Creat Button". When I click "Creat Button", program automatic creat a new button with weight and hight to EditText. Change value to EditText, click "CreatButton", => size of button change! Done!
Sorry, I come from VietNam, my English not good. Thanks all!
Reply with quote Reply Link ±0     (0 votes)
RE: How to Creat a dynamic button ???
created on May 1, 2012 12:59:06 PM
help me ! Please
Reply with quote Reply Link ±0     (0 votes)
RE: How to Creat a dynamic button ???
created on May 1, 2012 9:40:53 PM
This should not be too hard to do. What part are you having trouble with?
Reply with quote Reply Link ±0     (0 votes)
RE: How to Creat a dynamic button ???
created on Feb 4, 2013 1:33:32 PM
Button b = new Button(Context);
b.setHeight(your height)
b.setWidth(your widthy)
yourlayout.addView(b);

that's your button created on click.

now store the value of which you want to change and apply it to height and width of button.

if you want to like as change in edittext the size will change than i think ontextchangelistener will help you

still prob let me know
Reply with quote Reply Link ±0     (0 votes)