Here is what i want to do.
Lets say i have a parent linear layout and 3 childs in it.
{ ---------------- ++++++++++++++++ -------------- }
"+"/"-" are the layouts. What i want to do is this:
{------ ++++++++++++++++++++++++++++ -------} //1st step
{ +++++++++++++++++++++++++++++开发者_如何转开发+++++++ } //2nd step..
Animate the layout "+" taking over the layouts - . The same end result as having these 3 layout height "fill_parrent" with weights and Setvisibility to "Gone" for the "-" layouts but animated
You should look at http://developerlife.com/tutorials/?p=343 He gives very good examples on how to do something you want. I managed to create the move of the first layout to the top (he uses a left-to-right example). So you should move the first layout to the top, the third to the bottom and expand the middle layout after both are completed.
The only difficulty remaining is to get the LayoutParams right so that everything stays as you want it. In the end, you should have 3 animations: one that pushes the top layout off the top, one that does the some with the bottom and the last one that expands the middle one (if you don't want to animate it, you could just set the LayoutParams to both FILL_PARENT
精彩评论