Thanks for your reply NJDude. It doesn't seems to work either. The button2, is only half way on panel1. And secondly, I don't wish to resize my panel. I just want to set the panel1.bottom should be at the 89% of the Activity, which is working fine. But the views inside doesn't gets re-aligned in relation to the panel. The button1 should appear at the top of the panel and button2 should appear at the bottom of the panel. Is this a bug?
hmmm strange! It's sad. I only started using designer scripts and found this behaviour Lets see what Erel has to say about this. Hope to find a viable solution soon.
I understand the Button1.top = 0
But, why isn't button2.bottom = panel1.bottom right? As I am setting the bottom property of button2 to whatever it is of panel1. For e.g: If panel1.bottom = 300 then button2.bottom will be equal to 300. Therefore, the button2 should appear right at the end of the panel (without changing the height of the button).
Note that this code is logically wrong as you are first setting the Top property and then the Bottom property.
Lets say that Panel1.Top = 200 and Panel1.Bottom = 500 (Panel1.Height = 300).
When you set Button2.Bottom = Panel1.Bottom you are setting Button2.Bottom = 500 However Button2 is a child of Panel1. So 500 is relative to Panel1. As Panel1 height is only 300, Button2 will be hidden.
If you think of it, this is exactly the same reason that Button1.Top = 0 is correct.