5

I can't find a method that does this, but is there a way to reset the LayoutParams on an item?

On rotation of the device, I change the layout params. When I turn back to portrait, I want to change them back to the XML values. Do I just have to define new layout params that match what is in the XML?

Ronnie
  • 11,138
  • 21
  • 78
  • 140

1 Answers1

3

before you doing the Rotation , save the initialParams of your item , and after the rotation , when u want to change them back , u use the layoutParams that u 've saved from beginning

hope that's what you want :)

Houcine
  • 24,001
  • 13
  • 56
  • 83
  • just save the LayoutParams of the portrait mode, and after the rotation , you will set the new LayoutParams , and after switching back to portrait mode, just set the LayoutParams saved previously. But there is a better and a recommanded solution for this, which is using two different layout files, One for the portrait and the other one for the landscape mode. – Houcine Feb 05 '15 at 23:47